Chris@16: /*============================================================================= Chris@16: Copyright (c) 2001-2011 Joel de Guzman Chris@16: Copyright (c) 2006 Dan Marsden Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: ==============================================================================*/ Chris@16: #if !defined(FUSION_STRICTEST_TRAVERSAL_20060123_2101) Chris@16: #define FUSION_STRICTEST_TRAVERSAL_20060123_2101 Chris@16: Chris@101: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace fusion Chris@16: { Chris@16: struct forward_traversal_tag; Chris@16: struct bidirectional_traversal_tag; Chris@16: struct random_access_traversal_tag; Chris@16: Chris@16: namespace detail Chris@16: { Chris@16: template::value> Chris@16: struct stricter_traversal Chris@16: { Chris@16: typedef Tag1 type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct stricter_traversal Chris@16: { Chris@16: typedef Tag2 type; Chris@16: }; Chris@16: Chris@16: struct strictest_traversal_impl Chris@16: { Chris@16: template Chris@16: struct result; Chris@16: Chris@16: template Chris@16: struct result Chris@16: { Chris@16: typedef typename remove_reference::type next_value; Chris@16: typedef typename remove_reference::type strictest_so_far; Chris@16: Chris@16: typedef strictest_so_far tag1; Chris@16: typedef typename traits::category_of::type tag2; Chris@16: Chris@16: typedef typename stricter_traversal::type type; Chris@16: }; Chris@16: Chris@16: // never called, but needed for decltype-based result_of (C++0x) Chris@16: #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES Chris@16: template Chris@101: BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED Chris@16: typename result::type Chris@16: operator()(StrictestSoFar&&, Next&&) const; Chris@16: #endif Chris@16: }; Chris@16: Chris@16: template Chris@16: struct strictest_traversal Chris@16: : result_of::fold< Chris@16: Sequence, fusion::random_access_traversal_tag, Chris@16: strictest_traversal_impl> Chris@16: {}; Chris@16: Chris@16: } Chris@16: }} Chris@16: Chris@16: #endif