CppCMS
mem_bind.h
1 //
3 // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
4 //
5 // See accompanying file COPYING.TXT file for licensing details.
6 //
8 #ifndef CPPCMS_UTIL_MEM_BIND_H
9 #define CPPCMS_UTIL_MEM_BIND_H
10 
11 namespace cppcms { namespace util {
12 
14  namespace details {
15 
16  template<typename C,typename P,typename ... P1>
17  struct binderX {
18  void (C::*member)(P1...);
19  P object;
20  void operator()(P1... args) const { ((*object).*member)(args...); }
21  };
22  }
23 
25 
30  template<typename C,typename P,typename ...P1>
31  details::binderX<C,P,P1...> mem_bind(void (C::*mem)(P1...),P obj)
32  {
33  details::binderX<C,P,P1...> tmp={mem,obj};
34  return tmp;
35  }
36 
37 
38 } } // cppcms::util
39 
40 #endif
This is the namespace where all CppCMS functionality is placed.
Definition: application.h:19
details::binderX< C, P, P1... > mem_bind(void(C::*mem)(P1...), P obj)
Definition: mem_bind.h:31