OSDN Git Service

まぁ、method_pointer_make.hpp も追加
authormyun2 <myun2@nwhite.info>
Wed, 11 Jul 2012 17:28:53 +0000 (02:28 +0900)
committermyun2 <myun2@nwhite.info>
Wed, 11 Jul 2012 17:28:53 +0000 (02:28 +0900)
roast/include/roast/tp/method_pointer.hpp
roast/include/roast/tp/method_pointer_make.hpp [new file with mode: 0644]
roast/test/server_socket_test/server_socket_test.cpp

index 2103c26..686672d 100644 (file)
@@ -57,4 +57,6 @@ namespace roast
        /////////////////////////////////////////////////////////////
 }
 
+#include "roast/tp/method_pointer_make.hpp"
+
 #endif//__SFJP_ROAST___tp__method_pointer_HPP__
diff --git a/roast/include/roast/tp/method_pointer_make.hpp b/roast/include/roast/tp/method_pointer_make.hpp
new file mode 100644 (file)
index 0000000..5f9a19f
--- /dev/null
@@ -0,0 +1,20 @@
+//     Roast+ License
+
+#ifndef __SFJP_ROAST___tp__method_pointer_make_HPP__
+#define __SFJP_ROAST___tp__method_pointer_make_HPP__
+
+namespace roast
+{
+       /////////////////////////////////////////////////////////////
+       
+       
+       template <typename _Ret, typename _Class>
+       typename method_pointer_type<_Ret,_Class>::type make_method_pointer(_Ret (_Class::*p_func)() )
+       {
+               return method_pointer_type<_Ret,_Class>::type(p_func);
+       }
+       
+       /////////////////////////////////////////////////////////////
+}
+
+#endif//__SFJP_ROAST___tp__method_pointer_make_HPP__
index bed88f3..853306d 100644 (file)
@@ -25,7 +25,7 @@ void main( void )
        {
                //server_socket<connection_thread> ss(99);
 
-               method_pointer<void, A> p = &A::hoge;
+               method_pointer<void, A> p = make_method_pointer(&A::hoge); //&A::hoge;
                A a;
                p.call(a);
                p.call(&a);