libcopp  2.2.0
cmd_option_bindt_mf_cc.h
Go to the documentation of this file.
1 #ifndef UTIL_CLI_CMDOPTIONBINDT_MF_CC_H
2 #define UTIL_CLI_CMDOPTIONBINDT_MF_CC_H
3 
4 #pragma once
5 
6 /*
7  * cmd_option_bindt_mf_cc.h
8  *
9  * Created on: 2012-01-18
10  * Author: OWenT
11  *
12  * bind to member function
13  */
14 
15 namespace util {
16 namespace cli {
17 // 绑定器集合
18 namespace binder {
19 // ============================
20 // === 类绑定 ===
21 // ============================
22 
23 template <typename _T, typename _F>
25  private:
27 
28  public:
30 
31  template <typename _TCBP, typename... _Args>
32  void operator()(_TCBP &param, _T *arg0, _Args &...args) {
33  (arg0->*mem_func_)(param, args...);
34  }
35 
36  template <typename _TCBP, typename... _Args>
37  void operator()(_TCBP &param, _T &arg0, _Args &...args) {
38  (arg0.*mem_func_)(param, args...);
39  }
40 };
41 } // namespace binder
42 } // namespace cli
43 } // namespace util
44 #endif /* _CMDOPTIONBINDT_MF_CC_H_ */
void operator()(_TCBP &param, _T *arg0, _Args &...args)
void operator()(_TCBP &param, _T &arg0, _Args &...args)