1 /* Copyright 2016, The libsigc++ Development Team
2 * Assigned to public domain. Use as you wish without restriction.
6 #include <sigc++/member_method_trait.h>
15 void some_func(int a);
16 void some_const_func(int a) const;
17 void some_volatile_func(int a) volatile;
18 void some_const_volatile_func(int a) const volatile;
21 bool some_bool_func();
24 } // end anonymous namespace
26 void test_member_method_is_const()
28 static_assert(!sigc::internal::member_method_is_const<decltype(&Something::some_func)>::value,
29 "member_method_is_const failed to identify a non-const member method.");
31 static_assert(!sigc::internal::member_method_is_const<decltype(&Something::some_volatile_func)>::value,
32 "member_method_is_const failed to identify a non-const member method.");
34 static_assert(sigc::internal::member_method_is_const<decltype(&Something::some_const_func)>::value,
35 "member_method_is_const failed to identify a const member method.");
37 static_assert(sigc::internal::member_method_is_const<decltype(&Something::some_const_volatile_func)>::value,
38 "member_method_is_const failed to identify a const member method.");
41 void test_member_method_is_volatile()
43 static_assert(!sigc::internal::member_method_is_volatile<decltype(&Something::some_func)>::value,
44 "member_method_is_const failed to identify a non-volatile member method.");
46 static_assert(!sigc::internal::member_method_is_volatile<decltype(&Something::some_const_func)>::value,
47 "member_method_is_const failed to identify a non-volatile member method.");
49 static_assert(sigc::internal::member_method_is_volatile<decltype(&Something::some_volatile_func)>::value,
50 "member_method_is_const failed to identify a volatile member method.");
52 static_assert(sigc::internal::member_method_is_volatile<decltype(&Something::some_const_volatile_func)>::value,
53 "member_method_is_const failed to identify a volatile member method.");
56 void test_member_method_class_type()
58 static_assert(std::is_same<
59 sigc::internal::member_method_class<decltype(&Something::some_func)>::type,
61 "member_method_class_type failed to identify the class type.");
64 void test_member_method_result_type()
66 static_assert(std::is_same<
67 sigc::internal::member_method_result<decltype(&Something::some_int_func)>::type,
69 "member_method_result_type failed to identify the result type.");
71 static_assert(std::is_same<
72 sigc::internal::member_method_result<decltype(&Something::some_bool_func)>::type,
74 "member_method_result_type failed to identify the result type.");
79 test_member_method_is_const();
80 test_member_method_is_volatile();
82 test_member_method_class_type();
83 test_member_method_result_type();