/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman 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) ==============================================================================*/ #if !defined(FUSION_STD_TUPLE_ITERATOR_09112011_1905) #define FUSION_STD_TUPLE_ITERATOR_09112011_1905 #include #include #include #include #include #include #include #include #include #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable: 4512) // assignment operator could not be generated. #endif namespace boost { namespace fusion { struct random_access_traversal_tag; template struct std_tuple_iterator_identity; template struct std_tuple_iterator : iterator_facade< std_tuple_iterator , random_access_traversal_tag> { typedef Tuple tuple_type; static int const index = Index; typedef std_tuple_iterator_identity< typename add_const::type, Index> identity; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit std_tuple_iterator(Tuple& tuple) : tuple(tuple) {} Tuple& tuple; template struct value_of : std::tuple_element::type> {}; template struct deref { typedef typename value_of::type element; typedef typename mpl::if_< is_const , typename fusion::detail::cref_result::type , typename fusion::detail::ref_result::type >::type type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& iter) { return std::get(iter.tuple); } }; template struct advance { static int const index = Iterator::index; typedef typename Iterator::tuple_type tuple_type; typedef std_tuple_iterator type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(i.tuple); } }; template struct next : advance> {}; template struct prior : advance> {}; template struct equal_to : is_same {}; template struct distance { typedef mpl::int_ type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { return type(); } }; }; }} #ifdef _MSC_VER # pragma warning(pop) #endif #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408 namespace std { template struct iterator_traits< ::boost::fusion::std_tuple_iterator > { }; } #endif #endif