member_ccs_exact.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS
  7. #include <boost/mpl/assert.hpp>
  8. #include <boost/mpl/vector.hpp>
  9. #include <boost/function_types/member_function_pointer.hpp>
  10. #include <boost/function_types/is_callable_builtin.hpp>
  11. #ifndef BOOST_FT_CC_STDCALL
  12. # error "test not supported with this compiler/platform"
  13. #endif
  14. namespace ft = boost::function_types;
  15. namespace mpl = boost::mpl;
  16. typedef ft::stdcall_cc cc;
  17. typedef ft::default_cc dc;
  18. class C;
  19. BOOST_MPL_ASSERT((
  20. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C &>, cc>::type, cc >
  21. ));
  22. BOOST_MPL_ASSERT((
  23. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C const &>, cc>::type, cc >
  24. ));
  25. BOOST_MPL_ASSERT((
  26. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C volatile &>, cc>::type, cc >
  27. ));
  28. BOOST_MPL_ASSERT((
  29. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C const volatile &>, cc>::type, cc >
  30. ));
  31. BOOST_MPL_ASSERT((
  32. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C &> >::type, dc >
  33. ));
  34. BOOST_MPL_ASSERT_NOT((
  35. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C &>, cc>::type, dc >
  36. ));
  37. BOOST_MPL_ASSERT_NOT((
  38. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C const &>, cc>::type, dc >
  39. ));
  40. BOOST_MPL_ASSERT_NOT((
  41. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C volatile &>, cc>::type, dc >
  42. ));
  43. BOOST_MPL_ASSERT_NOT((
  44. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C const volatile &>, cc>::type, dc >
  45. ));
  46. BOOST_MPL_ASSERT_NOT((
  47. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C &> >::type, cc >
  48. ));
  49. BOOST_MPL_ASSERT_NOT((
  50. ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C &>, cc>::type, dc >
  51. ));