distortos  v0.6.0
object-oriented C++ RTOS for microcontrollers
TypeErasedFunctor.hpp
Go to the documentation of this file.
1 
12 #ifndef ESTD_TYPEERASEDFUNCTOR_HPP_
13 #define ESTD_TYPEERASEDFUNCTOR_HPP_
14 
15 namespace estd
16 {
17 
18 template<typename Signature, bool NonConst = {}>
20 
30 template<typename R, typename... Args>
31 class TypeErasedFunctor<R(Args...), false>
32 {
33 public:
34 
43  virtual R operator()(Args... args) const = 0;
44 
45 protected:
46 
53  ~TypeErasedFunctor() = default;
54 };
55 
65 template<typename R, typename... Args>
66 class TypeErasedFunctor<R(Args...), true>
67 {
68 public:
69 
78  virtual R operator()(Args... args) = 0;
79 
80 protected:
81 
88  ~TypeErasedFunctor() = default;
89 };
90 
91 } // namespace estd
92 
93 #endif // ESTD_TYPEERASEDFUNCTOR_HPP_
Collection of useful templates.
Definition: TypeErasedFunctor.hpp:19