delegates.h
Go to the documentation of this file.
1 #ifndef SOCKETCAN_INTERFACE_DELEGATES_H_
2 #define SOCKETCAN_INTERFACE_DELEGATES_H_
3 
4 #include <functional>
5 
6 namespace can
7 {
8 
9 template <typename T> class DelegateHelper : public T {
10 public:
11  template <typename Object, typename Instance, typename ...Args>
12  DelegateHelper(Object &&o, typename T::result_type (Instance::*member)(Args... args)) :
13  T([o, member](Args... args) -> typename T::result_type { return ((*o).*member)(args...); })
14  {
15  }
16  template <typename Callable>
17  DelegateHelper(Callable &&c) : T(c)
18  {
19  }
20 };
21 
22 } // namespace can
23 
24 #endif // SOCKETCAN_INTERFACE_DELEGATES_H_
DelegateHelper(Callable &&c)
Definition: delegates.h:17
Definition: asio_base.h:11
DelegateHelper(Object &&o, typename T::result_type(Instance::*member)(Args... args))
Definition: delegates.h:12


socketcan_interface
Author(s): Mathias L├╝dtke
autogenerated on Tue May 4 2021 02:50:18