distortos  v0.4.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 
54  {
55 
56  }
57 };
58 
68 template<typename R, typename... Args>
69 class TypeErasedFunctor<R(Args...), true>
70 {
71 public:
72 
81  virtual R operator()(Args... args) = 0;
82 
83 protected:
84 
92  {
93 
94  }
95 };
96 
97 } // namespace estd
98 
99 #endif // ESTD_TYPEERASEDFUNCTOR_HPP_
Collection of useful templates.
Definition: TypeErasedFunctor.hpp:19
~TypeErasedFunctor()
TypeErasedFunctor&#39;s destructor.
Definition: TypeErasedFunctor.hpp:91
~TypeErasedFunctor()
TypeErasedFunctor&#39;s destructor.
Definition: TypeErasedFunctor.hpp:53