is_cv_mem_func_ptr.cpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. // (C) Copyright Tobias Schwinger
  2. //
  3. // Use modification and distribution are subject to the boost Software License,
  4. // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
  5. //------------------------------------------------------------------------------
  6. #include <boost/mpl/assert.hpp>
  7. #include <boost/function_types/is_member_function_pointer.hpp>
  8. namespace ft = boost::function_types;
  9. class C;
  10. typedef void (C::*mem_func_ptr)();
  11. typedef void (C::*c_mem_func_ptr)() const;
  12. typedef void (C::*v_mem_func_ptr)() volatile;
  13. typedef void (C::*cv_mem_func_ptr)() const volatile;
  14. BOOST_MPL_ASSERT((
  15. ft::is_member_function_pointer< mem_func_ptr, ft::non_const >
  16. ));
  17. BOOST_MPL_ASSERT((
  18. ft::is_member_function_pointer< mem_func_ptr, ft::non_volatile >
  19. ));
  20. BOOST_MPL_ASSERT((
  21. ft::is_member_function_pointer< mem_func_ptr,
  22. ft::tag<ft::non_const, ft::non_volatile> >
  23. ));
  24. BOOST_MPL_ASSERT_NOT((
  25. ft::is_member_function_pointer< mem_func_ptr, ft::const_qualified >
  26. ));
  27. BOOST_MPL_ASSERT_NOT((
  28. ft::is_member_function_pointer< mem_func_ptr, ft::volatile_qualified >
  29. ));
  30. BOOST_MPL_ASSERT_NOT((
  31. ft::is_member_function_pointer< mem_func_ptr,
  32. ft::tag<ft::const_qualified, ft::volatile_qualified> >
  33. ));
  34. BOOST_MPL_ASSERT_NOT((
  35. ft::is_member_function_pointer< mem_func_ptr,
  36. ft::tag<ft::non_const, ft::volatile_qualified> >
  37. ));
  38. BOOST_MPL_ASSERT_NOT((
  39. ft::is_member_function_pointer< mem_func_ptr,
  40. ft::tag<ft::const_qualified, ft::non_volatile> >
  41. ));
  42. //
  43. BOOST_MPL_ASSERT((
  44. ft::is_member_function_pointer< c_mem_func_ptr, ft::const_qualified >
  45. ));
  46. BOOST_MPL_ASSERT((
  47. ft::is_member_function_pointer< c_mem_func_ptr, ft::non_volatile >
  48. ));
  49. BOOST_MPL_ASSERT_NOT((
  50. ft::is_member_function_pointer< c_mem_func_ptr, ft::non_const >
  51. ));
  52. BOOST_MPL_ASSERT_NOT((
  53. ft::is_member_function_pointer< c_mem_func_ptr, ft::volatile_qualified >
  54. ));
  55. BOOST_MPL_ASSERT((
  56. ft::is_member_function_pointer< c_mem_func_ptr,
  57. ft::tag<ft::const_qualified, ft::non_volatile> >
  58. ));
  59. BOOST_MPL_ASSERT_NOT((
  60. ft::is_member_function_pointer< c_mem_func_ptr,
  61. ft::tag<ft::non_const, ft::volatile_qualified> >
  62. ));
  63. //
  64. BOOST_MPL_ASSERT((
  65. ft::is_member_function_pointer< v_mem_func_ptr, ft::volatile_qualified >
  66. ));
  67. BOOST_MPL_ASSERT((
  68. ft::is_member_function_pointer< v_mem_func_ptr, ft::non_const >
  69. ));
  70. BOOST_MPL_ASSERT_NOT((
  71. ft::is_member_function_pointer< v_mem_func_ptr, ft::non_volatile >
  72. ));
  73. BOOST_MPL_ASSERT_NOT((
  74. ft::is_member_function_pointer< v_mem_func_ptr, ft::const_qualified >
  75. ));
  76. BOOST_MPL_ASSERT((
  77. ft::is_member_function_pointer< v_mem_func_ptr,
  78. ft::tag<ft::non_const, ft::volatile_qualified> >
  79. ));
  80. BOOST_MPL_ASSERT_NOT((
  81. ft::is_member_function_pointer< v_mem_func_ptr,
  82. ft::tag<ft::const_qualified, ft::non_volatile> >
  83. ));
  84. //
  85. BOOST_MPL_ASSERT((
  86. ft::is_member_function_pointer< cv_mem_func_ptr, ft::const_qualified >
  87. ));
  88. BOOST_MPL_ASSERT((
  89. ft::is_member_function_pointer< cv_mem_func_ptr, ft::volatile_qualified >
  90. ));
  91. BOOST_MPL_ASSERT_NOT((
  92. ft::is_member_function_pointer< cv_mem_func_ptr, ft::non_const >
  93. ));
  94. BOOST_MPL_ASSERT_NOT((
  95. ft::is_member_function_pointer< cv_mem_func_ptr, ft::non_volatile >
  96. ));
  97. BOOST_MPL_ASSERT_NOT((
  98. ft::is_member_function_pointer< cv_mem_func_ptr,
  99. ft::tag<ft::non_const, ft::non_volatile> >
  100. ));
  101. BOOST_MPL_ASSERT_NOT((
  102. ft::is_member_function_pointer< cv_mem_func_ptr,
  103. ft::tag<ft::const_qualified, ft::non_volatile> >
  104. ));
  105. BOOST_MPL_ASSERT_NOT((
  106. ft::is_member_function_pointer< cv_mem_func_ptr,
  107. ft::tag<ft::non_const, ft::volatile_qualified> >
  108. ));
  109. BOOST_MPL_ASSERT((
  110. ft::is_member_function_pointer< cv_mem_func_ptr,
  111. ft::tag<ft::const_qualified, ft::volatile_qualified> >
  112. ));