master.hpp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. // no include guards, this file is guarded externally
  7. #ifdef __WAVE__
  8. // this file has been generated from the master.hpp file in the same directory
  9. # pragma wave option(preserve: 0)
  10. #endif
  11. #if !defined(BOOST_FT_PREPROCESSING_MODE) || defined(BOOST_FT_CONFIG_HPP_INCLUDED)
  12. # error "this file used with two-pass preprocessing, only"
  13. #endif
  14. #include <boost/preprocessor/slot/slot.hpp>
  15. #include <boost/function_types/detail/encoding/def.hpp>
  16. namespace boost { namespace function_types {
  17. typedef detail::property_tag<BOOST_FT_non_variadic,BOOST_FT_variadic_mask> non_variadic;
  18. typedef detail::property_tag<BOOST_FT_variadic,BOOST_FT_variadic_mask> variadic;
  19. typedef detail::property_tag<0,BOOST_FT_const> non_const;
  20. typedef detail::property_tag<BOOST_FT_const,BOOST_FT_const> const_qualified;
  21. typedef detail::property_tag<0,BOOST_FT_volatile> non_volatile;
  22. typedef detail::property_tag<BOOST_FT_volatile,BOOST_FT_volatile> volatile_qualified;
  23. typedef detail::property_tag<BOOST_FT_default_cc,BOOST_FT_cc_mask> default_cc;
  24. #define BOOST_PP_VALUE BOOST_FT_const|BOOST_FT_volatile
  25. #include BOOST_PP_ASSIGN_SLOT(1)
  26. typedef detail::property_tag<0 , BOOST_PP_SLOT(1)> non_cv;
  27. typedef detail::property_tag<BOOST_FT_const , BOOST_PP_SLOT(1)> const_non_volatile;
  28. typedef detail::property_tag<BOOST_FT_volatile, BOOST_PP_SLOT(1)> volatile_non_const;
  29. typedef detail::property_tag<BOOST_PP_SLOT(1) , BOOST_PP_SLOT(1)> cv_qualified;
  30. namespace detail {
  31. typedef constant<BOOST_FT_full_mask> full_mask;
  32. template <bits_t Flags, bits_t CCID> struct encode_bits_impl
  33. {
  34. BOOST_STATIC_CONSTANT( bits_t, value =
  35. Flags | (BOOST_FT_default_cc * CCID) << 1 );
  36. };
  37. template <bits_t Flags, bits_t CCID, std::size_t Arity>
  38. struct encode_charr_impl
  39. {
  40. BOOST_STATIC_CONSTANT(std::size_t, value = (std::size_t)(1+
  41. Flags | (BOOST_FT_default_cc * CCID) << 1 | Arity << BOOST_FT_arity_shift
  42. ));
  43. };
  44. template <bits_t Bits> struct decode_bits
  45. {
  46. BOOST_STATIC_CONSTANT(bits_t, flags = Bits & BOOST_FT_flags_mask);
  47. BOOST_STATIC_CONSTANT(bits_t, cc_id =
  48. ( (Bits & BOOST_FT_full_mask) / BOOST_FT_default_cc) >> 1
  49. );
  50. BOOST_STATIC_CONSTANT(bits_t, tag_bits = (Bits & BOOST_FT_full_mask));
  51. BOOST_STATIC_CONSTANT(std::size_t, arity = (std::size_t)
  52. (Bits >> BOOST_FT_arity_shift)
  53. );
  54. };
  55. template <bits_t LHS_bits, bits_t LHS_mask, bits_t RHS_bits, bits_t RHS_mask>
  56. struct tag_ice
  57. {
  58. BOOST_STATIC_CONSTANT(bool, match =
  59. RHS_bits == (LHS_bits & RHS_mask & (RHS_bits |~BOOST_FT_type_mask))
  60. );
  61. BOOST_STATIC_CONSTANT(bits_t, combined_bits =
  62. (LHS_bits & ~RHS_mask) | RHS_bits
  63. );
  64. BOOST_STATIC_CONSTANT(bits_t, combined_mask =
  65. LHS_mask | RHS_mask
  66. );
  67. BOOST_STATIC_CONSTANT(bits_t, extracted_bits =
  68. LHS_bits & RHS_mask
  69. );
  70. };
  71. #define BOOST_FT_mask BOOST_FT_type_mask
  72. typedef property_tag<BOOST_FT_callable_builtin,BOOST_FT_mask> callable_builtin_tag;
  73. typedef property_tag<BOOST_FT_non_member_callable_builtin,BOOST_FT_mask> nonmember_callable_builtin_tag;
  74. typedef property_tag<BOOST_FT_function,BOOST_FT_mask> function_tag;
  75. typedef property_tag<BOOST_FT_reference,BOOST_FT_mask> reference_tag;
  76. typedef property_tag<BOOST_FT_pointer,BOOST_FT_mask> pointer_tag;
  77. typedef property_tag<BOOST_FT_member_function_pointer,BOOST_FT_mask> member_function_pointer_tag;
  78. typedef property_tag<BOOST_FT_member_object_pointer,BOOST_FT_mask> member_object_pointer_tag;
  79. typedef property_tag<BOOST_FT_member_object_pointer_flags,BOOST_FT_full_mask> member_object_pointer_base;
  80. typedef property_tag<BOOST_FT_member_pointer,BOOST_FT_mask> member_pointer_tag;
  81. #undef BOOST_FT_mask
  82. #define BOOST_PP_VALUE BOOST_FT_function|BOOST_FT_non_variadic|BOOST_FT_default_cc
  83. #include BOOST_PP_ASSIGN_SLOT(1)
  84. #define BOOST_PP_VALUE BOOST_FT_type_mask|BOOST_FT_variadic_mask|BOOST_FT_cc_mask
  85. #include BOOST_PP_ASSIGN_SLOT(2)
  86. typedef property_tag< BOOST_PP_SLOT(1) , BOOST_PP_SLOT(2) > nv_dcc_func;
  87. #define BOOST_PP_VALUE \
  88. BOOST_FT_member_function_pointer|BOOST_FT_non_variadic|BOOST_FT_default_cc
  89. #include BOOST_PP_ASSIGN_SLOT(1)
  90. typedef property_tag< BOOST_PP_SLOT(1) , BOOST_PP_SLOT(2) > nv_dcc_mfp;
  91. } // namespace detail
  92. } } // namespace ::boost::function_types