2 // (C) Copyright Tobias Schwinger
4 // Use modification and distribution are subject to the boost Software License,
5 // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
7 //------------------------------------------------------------------------------
9 #ifndef BOOST_FT_DETAIL_TAGS_HPP_INCLUDED
10 #define BOOST_FT_DETAIL_TAGS_HPP_INCLUDED
14 #include <boost/type_traits/integral_constant.hpp>
15 #include <boost/mpl/bitxor.hpp>
18 namespace boost { namespace function_types {
24 template<bits_t Value> struct constant
25 : boost::integral_constant<bits_t,Value>
28 template<bits_t Bits, bits_t Mask> struct property_tag
30 typedef constant<Bits> bits;
31 typedef constant<Mask> mask;
34 template<typename T> struct bits : T::bits { };
35 template<typename T> struct mask : T::mask { };
37 // forward declaration, defined in pp_tags
38 template<bits_t Bits, bits_t CCID> struct encode_bits_impl;
40 // forward declaration, defined in pp_tags
41 template<bits_t LHS_bits, bits_t LHS_mask,
42 bits_t RHS_bits, bits_t RHS_mask>
45 // forward declaration, defined in retag_default_cc
46 template<class Tag, class RegTag = Tag> struct retag_default_cc;
48 template<bits_t Bits, bits_t CCID> struct encode_bits
50 ::boost::function_types::detail::encode_bits_impl<Bits,CCID>::value
54 template<class LHS, class RHS> struct compound_tag
57 ::boost::function_types::detail::tag_ice
58 < ::boost::function_types::detail::bits<LHS>::value
59 , ::boost::function_types::detail::mask<LHS>::value
60 , ::boost::function_types::detail::bits<RHS>::value
61 , ::boost::function_types::detail::mask<RHS>::value
66 ::boost::function_types::detail::tag_ice
67 < ::boost::function_types::detail::bits<LHS>::value
68 , ::boost::function_types::detail::mask<LHS>::value
69 , ::boost::function_types::detail::bits<RHS>::value
70 , ::boost::function_types::detail::mask<RHS>::value
75 template <class Base, class PropOld, class PropNew>
80 <typename Base::bits, typename PropOld::bits, typename PropNew::bits>
84 template<class Tag, class QueryTag> struct represents_impl
85 : boost::integral_constant<bool,
86 ::boost::function_types::detail::tag_ice
87 < ::boost::function_types::detail::bits<Tag>::value
88 , ::boost::function_types::detail::mask<Tag>::value
89 , ::boost::function_types::detail::bits<QueryTag>::value
90 , ::boost::function_types::detail::mask<QueryTag>::value
97 typedef detail::property_tag<0,0> null_tag;
99 template<class Tag1, class Tag2, class Tag3 = null_tag, class Tag4 = null_tag>
101 : detail::compound_tag< detail::compound_tag<Tag1,Tag2>,
102 detail::compound_tag<Tag3,Tag4> >
105 template<class Tag1, class Tag2, class Tag3> struct tag<Tag1,Tag2,Tag3,null_tag>
106 : detail::compound_tag<detail::compound_tag<Tag1,Tag2>,Tag3>
108 template<class Tag1, class Tag2> struct tag<Tag1,Tag2,null_tag,null_tag>
109 : detail::compound_tag<Tag1,Tag2>
111 template<class Tag1> struct tag<Tag1,null_tag,null_tag,null_tag>
116 template<class Tag, class QueryTag> struct represents
117 : detail::represents_impl<Tag, detail::retag_default_cc<QueryTag,Tag> >
121 template<class Tag, class QueryTag> struct extract
123 typedef detail::constant<
124 ::boost::function_types::detail::tag_ice
125 < ::boost::function_types::detail::bits<Tag>::value
126 , ::boost::function_types::detail::mask<Tag>::value
127 , ::boost::function_types::detail::bits<QueryTag>::value
128 , ::boost::function_types::detail::mask<QueryTag>::value
132 typedef detail::constant<
133 ::boost::function_types::detail::mask<QueryTag>::value
137 } } // namespace ::boost::function_types
139 #include <boost/function_types/detail/pp_tags/preprocessed.hpp>
141 namespace boost { namespace function_types {
142 #define BOOST_FT_cc_file <boost/function_types/detail/pp_tags/cc_tag.hpp>
143 #include <boost/function_types/detail/pp_loop.hpp>
144 } } // namespace boost::function_types