/*============================================================================= Copyright (c) 2011-2017 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #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 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 T::template attribute {}; template struct attribute_of< T, Iterator, Context, typename std::enable_if< sprout::weed::traits::is_expr::value >::type > : public sprout::identity::attribute_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 sprout::weed::traits::attribute_of< typename sprout::weed::traits::terminal_of::type, Iterator, Context > {}; } // namespace traits } // namespace weed } // namespace sprout #endif // #ifndef SPROUT_WEED_TRAITS_PARSER_ATTRIBUTE_OF_HPP