Files

66 lines
1.8 KiB
C++
Raw Permalink Normal View History

2006-08-16 16:50:52 +00:00
/*=============================================================================
2011-09-16 05:30:23 +00:00
Copyright (c) 2001-2011 Joel de Guzman
2006-08-16 16:50:52 +00:00
2007-03-02 10:44:14 +00:00
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)
2006-08-16 16:50:52 +00:00
==============================================================================*/
#if !defined(FUSION_NEXT_05042005_1101)
#define FUSION_NEXT_05042005_1101
2014-01-09 17:58:06 -08:00
#include <boost/fusion/support/config.hpp>
2006-08-16 16:50:52 +00:00
#include <boost/fusion/support/tag_of.hpp>
namespace boost { namespace fusion
{
2006-09-25 09:06:15 +00:00
// Special tags:
struct iterator_facade_tag; // iterator facade tag
2010-02-07 18:22:06 +00:00
struct boost_array_iterator_tag; // boost::array iterator tag
2006-09-22 13:39:27 +00:00
struct mpl_iterator_tag; // mpl sequence iterator tag
struct std_pair_iterator_tag; // std::pair iterator tag
2006-08-16 16:50:52 +00:00
namespace extension
{
template <typename Tag>
struct next_impl
{
template <typename Iterator>
struct apply {};
};
2006-09-22 13:39:27 +00:00
2006-09-25 09:06:15 +00:00
template <>
struct next_impl<iterator_facade_tag>
{
template <typename Iterator>
struct apply : Iterator::template next<Iterator> {};
};
2006-09-22 13:39:27 +00:00
template <>
2010-02-07 18:22:06 +00:00
struct next_impl<boost_array_iterator_tag>;
2006-09-22 13:39:27 +00:00
template <>
struct next_impl<mpl_iterator_tag>;
template <>
struct next_impl<std_pair_iterator_tag>;
2006-08-16 16:50:52 +00:00
}
namespace result_of
{
template <typename Iterator>
struct next
: extension::next_impl<typename detail::tag_of<Iterator>::type>::
template apply<Iterator>
{};
}
template <typename Iterator>
2014-05-30 16:39:00 +02:00
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
2015-01-11 02:15:45 +09:00
inline typename result_of::next<Iterator>::type const
2006-08-16 16:50:52 +00:00
next(Iterator const& i)
{
return result_of::next<Iterator>::call(i);
}
}}
#endif