nonmember_ccs_exact.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/function_type.hpp>
  10. #include <boost/function_types/function_pointer.hpp>
  11. #include <boost/function_types/function_reference.hpp>
  12. #include <boost/function_types/is_callable_builtin.hpp>
  13. #ifndef BOOST_FT_CC_STDCALL
  14. # error "test not supported with this compiler/platform"
  15. #endif
  16. namespace ft = boost::function_types;
  17. namespace mpl = boost::mpl;
  18. typedef ft::stdcall_cc cc;
  19. typedef ft::default_cc dc;
  20. BOOST_MPL_ASSERT((
  21. ft::is_callable_builtin< ft::function_type<mpl::vector<void>,cc>::type, cc >
  22. ));
  23. BOOST_MPL_ASSERT((
  24. ft::is_callable_builtin< ft::function_pointer<mpl::vector<void>,cc>::type, cc >
  25. ));
  26. BOOST_MPL_ASSERT((
  27. ft::is_callable_builtin< ft::function_reference<mpl::vector<void>,cc>::type, cc >
  28. ));
  29. BOOST_MPL_ASSERT((
  30. ft::is_callable_builtin< ft::function_pointer<mpl::vector<void> >::type, dc >
  31. ));
  32. BOOST_MPL_ASSERT_NOT((
  33. ft::is_callable_builtin< ft::function_type<mpl::vector<void>, cc>::type, dc >
  34. ));
  35. BOOST_MPL_ASSERT_NOT((
  36. ft::is_callable_builtin< ft::function_pointer<mpl::vector<void>,cc>::type, dc >
  37. ));
  38. BOOST_MPL_ASSERT_NOT((
  39. ft::is_callable_builtin< ft::function_reference<mpl::vector<void>,cc>::type, dc >
  40. ));
  41. BOOST_MPL_ASSERT_NOT((
  42. ft::is_callable_builtin< ft::function_pointer<mpl::vector<void> >::type, cc >
  43. ));