pmf.hpp 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. @Copyright Barrett Adair 2015-2017
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. */
  6. #ifndef BOOST_CLBL_TRTS_DETAIL_PMF_HPP
  7. #define BOOST_CLBL_TRTS_DETAIL_PMF_HPP
  8. #include <boost/callable_traits/detail/forward_declarations.hpp>
  9. #include <boost/callable_traits/detail/set_function_qualifiers.hpp>
  10. #include <boost/callable_traits/detail/qualifier_flags.hpp>
  11. #include <boost/callable_traits/detail/default_callable_traits.hpp>
  12. #include <boost/callable_traits/detail/utility.hpp>
  13. namespace boost { namespace callable_traits { namespace detail {
  14. template<qualifier_flags Applied, bool IsTransactionSafe, bool IsNoExcept,
  15. typename CallingConvention, typename T, typename Return,
  16. typename... Args>
  17. struct set_member_function_qualifiers_t;
  18. template<qualifier_flags Applied, bool IsTransactionSafe, bool IsNoexcept,
  19. typename CallingConvention, typename T, typename Return,
  20. typename... Args>
  21. struct set_varargs_member_function_qualifiers_t;
  22. template<qualifier_flags Flags, bool IsTransactionSafe, bool IsNoexcept,
  23. typename... Ts>
  24. using set_member_function_qualifiers =
  25. typename set_member_function_qualifiers_t<Flags, IsTransactionSafe,
  26. IsNoexcept, Ts...>::type;
  27. template<qualifier_flags Flags, bool IsTransactionSafe, bool IsNoexcept,
  28. typename... Ts>
  29. using set_varargs_member_function_qualifiers =
  30. typename set_varargs_member_function_qualifiers_t<Flags,
  31. IsTransactionSafe, IsNoexcept, Ts...>::type;
  32. template<typename T>
  33. struct pmf : default_callable_traits<T> {};
  34. #define BOOST_CLBL_TRTS_CC_TAG dummy
  35. #define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
  36. #define BOOST_CLBL_TRTS_CC
  37. #include <boost/callable_traits/detail/unguarded/pmf.hpp>
  38. #undef BOOST_CLBL_TRTS_CC
  39. #undef BOOST_CLBL_TRTS_CC_TAG
  40. #undef BOOST_CLBL_TRTS_VARARGS_CC
  41. #define BOOST_CLBL_TRTS_CC_TAG dummy
  42. #define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
  43. #define BOOST_CLBL_TRTS_CC
  44. #include <boost/callable_traits/detail/unguarded/pmf_varargs.hpp>
  45. #undef BOOST_CLBL_TRTS_CC
  46. #undef BOOST_CLBL_TRTS_CC_TAG
  47. #undef BOOST_CLBL_TRTS_VARARGS_CC
  48. #ifdef BOOST_CLBL_TRTS_ENABLE_CDECL
  49. #define BOOST_CLBL_TRTS_CC_TAG cdecl_tag
  50. #define BOOST_CLBL_TRTS_VARARGS_CC __cdecl
  51. #define BOOST_CLBL_TRTS_CC __cdecl
  52. #include <boost/callable_traits/detail/unguarded/pmf.hpp>
  53. #undef BOOST_CLBL_TRTS_CC
  54. #undef BOOST_CLBL_TRTS_CC_TAG
  55. #undef BOOST_CLBL_TRTS_VARARGS_CC
  56. #endif // #ifdef BOOST_CLBL_TRTS_ENABLE_CDECL
  57. // Defining this macro enables undocumented features, likely broken.
  58. // Too much work to maintain, but knock yourself out
  59. #ifdef BOOST_CLBL_TRTS_ENABLE_STDCALL
  60. #define BOOST_CLBL_TRTS_CC_TAG stdcall_tag
  61. #define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
  62. #define BOOST_CLBL_TRTS_CC __stdcall
  63. #include <boost/callable_traits/detail/unguarded/pmf.hpp>
  64. #undef BOOST_CLBL_TRTS_CC
  65. #undef BOOST_CLBL_TRTS_CC_TAG
  66. #undef BOOST_CLBL_TRTS_VARARGS_CC
  67. #endif // #ifdef BOOST_CLBL_TRTS_ENABLE_STDCALL
  68. // Defining this macro enables undocumented features, likely broken.
  69. // Too much work to officially maintain, but knock yourself out
  70. #ifdef BOOST_CLBL_TRTS_ENABLE_FASTCALL
  71. #define BOOST_CLBL_TRTS_CC_TAG fastcall_tag
  72. #define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
  73. #define BOOST_CLBL_TRTS_CC __fastcall
  74. #include <boost/callable_traits/detail/unguarded/pmf.hpp>
  75. #undef BOOST_CLBL_TRTS_CC
  76. #undef BOOST_CLBL_TRTS_CC_TAG
  77. #undef BOOST_CLBL_TRTS_VARARGS_CC
  78. #endif // #ifdef BOOST_CLBL_TRTS_ENABLE_FASTCALL
  79. }}} // namespace boost::callable_traits::detail
  80. #endif // #ifndef BOOST_CLBL_TRTS_DETAIL_PMF_HPP