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