File indexing completed on 2025-01-31 10:02:38
0001
0002
0003
0004
0005
0006
0007
0008
0009 #if !defined(BOOST_SPIRIT_X3_HAS_ATTRIBUTE_JUN_6_2012_1714PM)
0010 #define BOOST_SPIRIT_X3_HAS_ATTRIBUTE_JUN_6_2012_1714PM
0011
0012 #include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
0013 #include <boost/spirit/home/x3/support/utility/sfinae.hpp>
0014 #include <boost/mpl/bool.hpp>
0015 #include <boost/mpl/not.hpp>
0016 #include <boost/type_traits/is_same.hpp>
0017 #include <boost/utility/enable_if.hpp>
0018
0019 namespace boost { namespace spirit { namespace x3
0020 {
0021 struct unused_type;
0022 }}}
0023
0024 namespace boost { namespace spirit { namespace x3 { namespace traits
0025 {
0026
0027
0028
0029
0030
0031
0032 template <typename Component, typename Context, typename Enable = void>
0033 struct has_attribute;
0034
0035 namespace detail
0036 {
0037 template <typename Component, typename Context, typename Enable = void>
0038 struct default_has_attribute
0039 : mpl::not_<is_same<unused_type,
0040 typename attribute_of<Component, Context>::type>> {};
0041
0042 template <typename Component, typename Context>
0043 struct default_has_attribute<Component, Context,
0044 typename disable_if_substitution_failure<
0045 mpl::bool_<Component::has_attribute>>::type>
0046 : mpl::bool_<Component::has_attribute> {};
0047
0048 template <typename Component, typename Context>
0049 struct default_has_attribute<Component, Context,
0050 typename enable_if_c<Component::is_pass_through_unary>::type>
0051 : has_attribute<typename Component::subject_type, Context> {};
0052 }
0053
0054 template <typename Component, typename Context, typename Enable>
0055 struct has_attribute : detail::default_has_attribute<Component, Context> {};
0056
0057 }}}}
0058
0059 #endif