forked from boostorg/fusion
Merge from trunk
[SVN r39533]
This commit is contained in:
1 parent
1e162a7266
commit
6655ec7dee
257 files changed
+6854
-5893
No files matched your search
@@ -1,7 +1,7 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
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_BOOST_TUPLE_ITERATOR_09262006_1851)
|
||||
@@ -19,6 +19,24 @@ namespace boost { namespace fusion
|
||||
{
|
||||
struct forward_traversal_tag;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
struct boost_tuple_is_empty : mpl::false_ {};
|
||||
|
||||
template <>
|
||||
struct boost_tuple_is_empty<tuples::null_type> : mpl::true_ {};
|
||||
|
||||
template <>
|
||||
struct boost_tuple_is_empty<tuples::null_type const> : mpl::true_ {};
|
||||
|
||||
template <>
|
||||
struct boost_tuple_is_empty<tuples::tuple<> > : mpl::true_ {};
|
||||
|
||||
template <>
|
||||
struct boost_tuple_is_empty<tuples::tuple<> const> : mpl::true_ {};
|
||||
}
|
||||
|
||||
template <typename Cons = tuples::null_type>
|
||||
struct boost_tuple_iterator
|
||||
: iterator_facade<boost_tuple_iterator<Cons>, forward_traversal_tag>
|
||||
@@ -36,13 +54,13 @@ namespace boost { namespace fusion
|
||||
struct deref
|
||||
{
|
||||
typedef typename value_of<Iterator>::type element;
|
||||
|
||||
typedef typename
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
is_const<typename Iterator::cons_type>
|
||||
, typename tuples::access_traits<element>::const_type
|
||||
, typename tuples::access_traits<element>::non_const_type
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
@@ -74,9 +92,27 @@ namespace boost { namespace fusion
|
||||
};
|
||||
};
|
||||
|
||||
template <typename Null>
|
||||
struct boost_tuple_null_iterator
|
||||
: iterator_facade<boost_tuple_iterator<Null>, forward_traversal_tag>
|
||||
{
|
||||
typedef Null cons_type;
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct equal_to
|
||||
: mpl::or_<
|
||||
is_same<I1, I2>
|
||||
, mpl::and_<
|
||||
detail::boost_tuple_is_empty<typename I1::cons_type>
|
||||
, detail::boost_tuple_is_empty<typename I2::cons_type>
|
||||
>
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct boost_tuple_iterator<tuples::null_type>
|
||||
: iterator_facade<boost_tuple_iterator<tuples::null_type>, forward_traversal_tag>
|
||||
: boost_tuple_null_iterator<tuples::null_type>
|
||||
{
|
||||
template <typename Cons>
|
||||
explicit boost_tuple_iterator(Cons const&) {}
|
||||
@@ -84,7 +120,7 @@ namespace boost { namespace fusion
|
||||
|
||||
template <>
|
||||
struct boost_tuple_iterator<tuples::null_type const>
|
||||
: iterator_facade<boost_tuple_iterator<tuples::null_type const>, forward_traversal_tag>
|
||||
: boost_tuple_null_iterator<tuples::null_type const>
|
||||
{
|
||||
template <typename Cons>
|
||||
explicit boost_tuple_iterator(Cons const&) {}
|
||||
@@ -92,7 +128,7 @@ namespace boost { namespace fusion
|
||||
|
||||
template <>
|
||||
struct boost_tuple_iterator<tuples::tuple<> >
|
||||
: iterator_facade<boost_tuple_iterator<tuples::tuple<> >, forward_traversal_tag>
|
||||
: boost_tuple_null_iterator<tuples::tuple<> >
|
||||
{
|
||||
template <typename Cons>
|
||||
explicit boost_tuple_iterator(Cons const&) {}
|
||||
@@ -100,7 +136,7 @@ namespace boost { namespace fusion
|
||||
|
||||
template <>
|
||||
struct boost_tuple_iterator<tuples::tuple<> const>
|
||||
: iterator_facade<boost_tuple_iterator<tuples::tuple<> const>, forward_traversal_tag>
|
||||
: boost_tuple_null_iterator<tuples::tuple<> const>
|
||||
{
|
||||
template <typename Cons>
|
||||
explicit boost_tuple_iterator(Cons const&) {}
|
||||
|
||||
Reference in new issue
Block a user