mem_func_ptr_cv_ptr_to_this.cpp 937 B

12345678910111213141516171819202122232425262728293031323334353637
  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/mpl/vector.hpp>
  8. #include <boost/type_traits/is_same.hpp>
  9. #include <boost/function_types/member_function_pointer.hpp>
  10. namespace ft = boost::function_types;
  11. namespace mpl = boost::mpl;
  12. using boost::is_same;
  13. class C;
  14. typedef int (C::* expected)();
  15. BOOST_MPL_ASSERT((
  16. is_same< ft::member_function_pointer< mpl::vector<int,C * const> >::type
  17. , expected >
  18. ));
  19. BOOST_MPL_ASSERT((
  20. is_same< ft::member_function_pointer< mpl::vector<int,C * volatile> >::type
  21. , expected >
  22. ));
  23. BOOST_MPL_ASSERT((
  24. is_same< ft::member_function_pointer< mpl::vector<int,C * const volatile> >::type
  25. , expected >
  26. ));