#ifndef SPROUT_WEED_TRAITS_PARSER_ATTRIBUTE_OF_HPP #define SPROUT_WEED_TRAITS_PARSER_ATTRIBUTE_OF_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace sprout { namespace weed { namespace traits { // // attribute_of // template struct attribute_of; template struct attribute_of : public sprout::weed::traits::attribute_of {}; template struct attribute_of< T, Iterator, Context, typename std::enable_if< sprout::weed::traits::is_parser::value && !sprout::weed::traits::is_expr::value && !sprout::weed::traits::is_char_type::value && !sprout::weed::traits::is_c_str::value && !sprout::weed::traits::is_string::value >::type > { public: typedef typename T::template attribute::type type; }; template struct attribute_of< T, Iterator, Context, typename std::enable_if< sprout::weed::traits::is_char_type::value || sprout::weed::traits::is_c_str::value || sprout::weed::traits::is_string::value >::type > { public: typedef sprout::weed::unused type; }; template struct attribute_of, Iterator, Context> : public sprout::weed::traits::attribute_of {}; template struct attribute_of, Iterator, Context> : public sprout::weed::attr_cnv::result_of::times< sprout::weed::traits::limit_of::value, typename sprout::weed::traits::attribute_of::type > {}; template struct attribute_of, Iterator, Context> : public sprout::weed::attr_cnv::result_of::negate< typename sprout::weed::traits::attribute_of::type > {}; template struct attribute_of, Iterator, Context> : public sprout::weed::attr_cnv::result_of::times< sprout::weed::traits::limit_of::value, typename sprout::weed::traits::attribute_of::type > {}; template struct attribute_of, Iterator, Context> { public: typedef sprout::weed::unused type; }; template struct attribute_of, Iterator, Context> { public: typedef sprout::weed::unused type; }; template struct attribute_of, Iterator, Context> : public sprout::weed::attr_cnv::result_of::shift_left< typename sprout::weed::traits::attribute_of::type, typename sprout::weed::traits::attribute_of::type > {}; template struct attribute_of, Iterator, Context> : public sprout::weed::attr_cnv::result_of::modulus< sprout::weed::traits::limit_of::value, typename sprout::weed::traits::attribute_of::type > {}; template struct attribute_of, Iterator, Context> { public: typedef typename sprout::weed::traits::attribute_of::type type; }; template struct attribute_of, Iterator, Context> : public sprout::weed::attr_cnv::result_of::bitwise_or< typename sprout::weed::traits::attribute_of::type, typename sprout::weed::traits::attribute_of::type > {}; } // namespace traits } // namespace weed } // namespace sprout #endif // #ifndef SPROUT_WEED_TRAITS_PARSER_ATTRIBUTE_OF_HPP