forked from boostorg/fusion
Initial move from Spirit CVS
[SVN r34896]
This commit is contained in:
72
include/boost/fusion/iterator/advance.hpp
Normal file
72
include/boost/fusion/iterator/advance.hpp
Normal file
@ -0,0 +1,72 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_ADVANCE_09172005_1146)
|
||||
#define FUSION_ADVANCE_09172005_1146
|
||||
|
||||
#include <boost/fusion/iterator/detail/advance.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct advance_impl
|
||||
{
|
||||
// default implementation
|
||||
template <typename Iterator, typename N>
|
||||
struct apply :
|
||||
mpl::if_c<
|
||||
(N::value > 0)
|
||||
, advance_detail::forward<Iterator, N::value>
|
||||
, advance_detail::backward<Iterator, N::value>
|
||||
>::type
|
||||
{
|
||||
typedef typename traits::category_of<Iterator>::type category;
|
||||
BOOST_MPL_ASSERT_NOT((is_same<category, random_access_traversal_tag>));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Iterator, int N>
|
||||
struct advance_c
|
||||
: extension::advance_impl<typename detail::tag_of<Iterator>::type>::template apply<Iterator, mpl::int_<N> >
|
||||
{};
|
||||
|
||||
template <typename Iterator, typename N>
|
||||
struct advance
|
||||
: extension::advance_impl<typename detail::tag_of<Iterator>::type>::template apply<Iterator, N>
|
||||
{};
|
||||
}
|
||||
|
||||
template <int N, typename Iterator>
|
||||
inline typename result_of::advance_c<Iterator, N>::type
|
||||
advance_c(Iterator const& i)
|
||||
{
|
||||
return result_of::advance_c<Iterator, N>::call(i);
|
||||
}
|
||||
|
||||
template<typename N, typename Iterator>
|
||||
inline typename result_of::advance<Iterator, N>::type
|
||||
advance(Iterator const& i)
|
||||
{
|
||||
return result_of::advance<Iterator, N>::call(i);
|
||||
}
|
||||
|
||||
}} // namespace boost::fusion
|
||||
|
||||
#endif
|
52
include/boost/fusion/iterator/deref.hpp
Normal file
52
include/boost/fusion/iterator/deref.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_DEREF_05042005_1019)
|
||||
#define FUSION_DEREF_05042005_1019
|
||||
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct deref_impl
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply {};
|
||||
};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct deref
|
||||
: extension::deref_impl<typename detail::tag_of<Iterator>::type>::
|
||||
template apply<Iterator>
|
||||
{};
|
||||
}
|
||||
|
||||
template <typename Iterator>
|
||||
typename result_of::deref<Iterator>::type
|
||||
deref(Iterator const& i)
|
||||
{
|
||||
typedef result_of::deref<Iterator> deref_meta;
|
||||
typename deref_meta::type result(deref_meta::call(i));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename Iterator>
|
||||
typename result_of::deref<Iterator>::type
|
||||
operator*(iterator_base<Iterator> const& i)
|
||||
{
|
||||
return fusion::deref(i.cast());
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
35
include/boost/fusion/iterator/detail/adapt_deref_traits.hpp
Normal file
35
include/boost/fusion/iterator/detail/adapt_deref_traits.hpp
Normal file
@ -0,0 +1,35 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_ADAPT_DEREF_TRAITS_05062005_0900)
|
||||
#define FUSION_ADAPT_DEREF_TRAITS_05062005_0900
|
||||
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
struct adapt_deref_traits
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref<typename Iterator::first_type>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return *i.first;
|
||||
}
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
|
29
include/boost/fusion/iterator/detail/adapt_value_traits.hpp
Normal file
29
include/boost/fusion/iterator/detail/adapt_value_traits.hpp
Normal file
@ -0,0 +1,29 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_ADAPT_VALUE_TRAITS_05062005_0859)
|
||||
#define FUSION_ADAPT_VALUE_TRAITS_05062005_0859
|
||||
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
struct adapt_value_traits
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::value_of<typename Iterator::first_type>::type
|
||||
type;
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
|
103
include/boost/fusion/iterator/detail/advance.hpp
Normal file
103
include/boost/fusion/iterator/detail/advance.hpp
Normal file
@ -0,0 +1,103 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_ADVANCE_09172005_1149)
|
||||
#define FUSION_ADVANCE_09172005_1149
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace advance_detail
|
||||
{
|
||||
// Default advance implementation, perform next(i)
|
||||
// or prior(i) N times.
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct forward;
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct next_forward
|
||||
{
|
||||
typedef typename
|
||||
forward<
|
||||
typename result_of::next<Iterator>::type
|
||||
, N-1
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct forward
|
||||
{
|
||||
typedef typename
|
||||
mpl::eval_if_c<
|
||||
(N == 0)
|
||||
, mpl::identity<Iterator>
|
||||
, next_forward<Iterator, N>
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type const&
|
||||
call(type const& i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
static type
|
||||
call(I const& i)
|
||||
{
|
||||
return call(fusion::next(i));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct backward;
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct next_backward
|
||||
{
|
||||
typedef typename
|
||||
backward<
|
||||
typename result_of::prior<Iterator>::type
|
||||
, N+1
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct backward
|
||||
{
|
||||
typedef typename
|
||||
mpl::eval_if_c<
|
||||
(N == 0)
|
||||
, mpl::identity<Iterator>
|
||||
, next_backward<Iterator, N>
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type const&
|
||||
call(type const& i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
static type
|
||||
call(I const& i)
|
||||
{
|
||||
return call(fusion::prior(i));
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
66
include/boost/fusion/iterator/detail/distance.hpp
Normal file
66
include/boost/fusion/iterator/detail/distance.hpp
Normal file
@ -0,0 +1,66 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_DISTANCE_09172005_0730)
|
||||
#define FUSION_DISTANCE_09172005_0730
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/next.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace distance_detail
|
||||
{
|
||||
// Default distance implementation, linear
|
||||
// search for the Last iterator.
|
||||
|
||||
template <typename First, typename Last>
|
||||
struct linear_distance;
|
||||
|
||||
template <typename First, typename Last>
|
||||
struct next_distance
|
||||
{
|
||||
typedef typename
|
||||
mpl::next<
|
||||
typename linear_distance<
|
||||
typename result_of::next<First>::type
|
||||
, Last
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename First, typename Last>
|
||||
struct linear_distance
|
||||
: mpl::eval_if<
|
||||
result_of::equal_to<First, Last>
|
||||
, mpl::identity<mpl::int_<0> >
|
||||
, next_distance<First, Last>
|
||||
>::type
|
||||
{
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
result_of::equal_to<First, Last>
|
||||
, mpl::identity<mpl::int_<0> >
|
||||
, next_distance<First, Last>
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(First const&, Last const&)
|
||||
{
|
||||
static type result;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
58
include/boost/fusion/iterator/distance.hpp
Normal file
58
include/boost/fusion/iterator/distance.hpp
Normal file
@ -0,0 +1,58 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_DISTANCE_09172005_0721)
|
||||
#define FUSION_DISTANCE_09172005_0721
|
||||
|
||||
#include <boost/fusion/iterator/detail/distance.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct distance_impl
|
||||
{
|
||||
// default implementation
|
||||
template <typename First, typename Last>
|
||||
struct apply : distance_detail::linear_distance<First, Last>
|
||||
{
|
||||
typedef typename traits::category_of<First>::type first_category;
|
||||
typedef typename traits::category_of<Last>::type last_category;
|
||||
BOOST_MPL_ASSERT((is_same<first_category, last_category>));
|
||||
BOOST_MPL_ASSERT_NOT((is_same<first_category, random_access_traversal_tag>));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename First, typename Last>
|
||||
struct distance
|
||||
: extension::distance_impl<typename detail::tag_of<First>::type>::
|
||||
template apply<First, Last>
|
||||
{};
|
||||
}
|
||||
|
||||
template <typename First, typename Last>
|
||||
inline typename result_of::distance<First, Last>::type
|
||||
distance(First const& a, Last const& b)
|
||||
{
|
||||
return result_of::distance<First, Last>::call(a,b);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
72
include/boost/fusion/iterator/equal_to.hpp
Normal file
72
include/boost/fusion/iterator/equal_to.hpp
Normal file
@ -0,0 +1,72 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_EQUAL_TO_05052005_1208)
|
||||
#define FUSION_EQUAL_TO_05052005_1208
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/fusion/support/is_iterator.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct equal_to_impl
|
||||
{
|
||||
// default implementation
|
||||
template <typename I1, typename I2>
|
||||
struct apply
|
||||
: is_same<typename add_const<I1>::type, typename add_const<I2>::type>
|
||||
{};
|
||||
};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename I1, typename I2>
|
||||
struct equal_to
|
||||
: extension::equal_to_impl<typename detail::tag_of<I1>::type>::
|
||||
template apply<I1, I2>
|
||||
{};
|
||||
}
|
||||
|
||||
namespace iterator_operators
|
||||
{
|
||||
template <typename Iter1, typename Iter2>
|
||||
inline typename
|
||||
enable_if<
|
||||
mpl::and_<is_fusion_iterator<Iter1>, is_fusion_iterator<Iter2> >
|
||||
, bool
|
||||
>::type
|
||||
operator==(Iter1 const&, Iter2 const&)
|
||||
{
|
||||
return result_of::equal_to<Iter1, Iter2>::value;
|
||||
}
|
||||
|
||||
template <typename Iter1, typename Iter2>
|
||||
inline typename
|
||||
enable_if<
|
||||
mpl::and_<is_fusion_iterator<Iter1>, is_fusion_iterator<Iter2> >
|
||||
, bool
|
||||
>::type
|
||||
operator!=(Iter1 const&, Iter2 const&)
|
||||
{
|
||||
return !result_of::equal_to<Iter1, Iter2>::value;
|
||||
}
|
||||
}
|
||||
|
||||
using iterator_operators::operator==;
|
||||
using iterator_operators::operator!=;
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
14
include/boost/fusion/iterator/mpl.hpp
Normal file
14
include/boost/fusion/iterator/mpl.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_ITERATOR_MPL_10022005_0557)
|
||||
#define FUSION_ITERATOR_MPL_10022005_0557
|
||||
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
#include <boost/fusion/iterator/mpl/fusion_iterator.hpp>
|
||||
|
||||
#endif
|
57
include/boost/fusion/iterator/mpl/convert_iterator.hpp
Normal file
57
include/boost/fusion/iterator/mpl/convert_iterator.hpp
Normal file
@ -0,0 +1,57 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_CONVERT_ITERATOR_05062005_1218)
|
||||
#define FUSION_CONVERT_ITERATOR_05062005_1218
|
||||
|
||||
#include <boost/fusion/support/is_iterator.hpp>
|
||||
#include <boost/fusion/sequence/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
// Test T. If it is a fusion iterator, return a reference to it.
|
||||
// else, assume it is an mpl iterator.
|
||||
|
||||
template <typename T>
|
||||
struct convert_iterator
|
||||
{
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
is_fusion_iterator<T>
|
||||
, T
|
||||
, mpl_iterator<T>
|
||||
>::type
|
||||
type;
|
||||
|
||||
static T const&
|
||||
call(T const& x, mpl::true_)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
static mpl_iterator<T>
|
||||
call(T const& x, mpl::false_)
|
||||
{
|
||||
return mpl_iterator<T>();
|
||||
}
|
||||
|
||||
static typename
|
||||
mpl::if_<
|
||||
is_fusion_iterator<T>
|
||||
, T const&
|
||||
, mpl_iterator<T>
|
||||
>::type
|
||||
call(T const& x)
|
||||
{
|
||||
return call(x, is_fusion_iterator<T>());
|
||||
}
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
56
include/boost/fusion/iterator/mpl/fusion_iterator.hpp
Normal file
56
include/boost/fusion/iterator/mpl/fusion_iterator.hpp
Normal file
@ -0,0 +1,56 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_FUSION_ITERATOR_10012005_1551)
|
||||
#define FUSION_FUSION_ITERATOR_10012005_1551
|
||||
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <boost/fusion/iterator/distance.hpp>
|
||||
#include <boost/mpl/next_prior.hpp>
|
||||
#include <boost/mpl/advance_fwd.hpp>
|
||||
#include <boost/mpl/distance_fwd.hpp>
|
||||
|
||||
namespace boost { namespace mpl
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct fusion_iterator
|
||||
{
|
||||
typedef typename fusion::result_of::value_of<Iterator>::type type;
|
||||
typedef Iterator iterator;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct next<fusion_iterator<Iterator> >
|
||||
{
|
||||
typedef fusion_iterator<typename fusion::result_of::next<Iterator>::type> type;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct prior<fusion_iterator<Iterator> >
|
||||
{
|
||||
typedef fusion_iterator<typename fusion::result_of::prior<Iterator>::type> type;
|
||||
};
|
||||
|
||||
template <typename Iterator, typename N>
|
||||
struct advance<fusion_iterator<Iterator>, N>
|
||||
{
|
||||
typedef fusion_iterator<typename fusion::result_of::advance<Iterator, N>::type> type;
|
||||
};
|
||||
|
||||
template <typename First, typename Last>
|
||||
struct distance<fusion_iterator<First>, fusion_iterator<Last> >
|
||||
: fusion::result_of::distance<First, Last>
|
||||
{};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
42
include/boost/fusion/iterator/next.hpp
Normal file
42
include/boost/fusion/iterator/next.hpp
Normal file
@ -0,0 +1,42 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_NEXT_05042005_1101)
|
||||
#define FUSION_NEXT_05042005_1101
|
||||
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct next_impl
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply {};
|
||||
};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct next
|
||||
: extension::next_impl<typename detail::tag_of<Iterator>::type>::
|
||||
template apply<Iterator>
|
||||
{};
|
||||
}
|
||||
|
||||
template <typename Iterator>
|
||||
typename result_of::next<Iterator>::type
|
||||
next(Iterator const& i)
|
||||
{
|
||||
return result_of::next<Iterator>::call(i);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
42
include/boost/fusion/iterator/prior.hpp
Normal file
42
include/boost/fusion/iterator/prior.hpp
Normal file
@ -0,0 +1,42 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_PRIOR_05042005_1144)
|
||||
#define FUSION_PRIOR_05042005_1144
|
||||
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct prior_impl
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply {};
|
||||
};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct prior
|
||||
: extension::prior_impl<typename detail::tag_of<Iterator>::type>::
|
||||
template apply<Iterator>
|
||||
{};
|
||||
}
|
||||
|
||||
template <typename Iterator>
|
||||
typename result_of::prior<Iterator>::type
|
||||
prior(Iterator const& i)
|
||||
{
|
||||
return result_of::prior<Iterator>::call(i);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
36
include/boost/fusion/iterator/value_of.hpp
Normal file
36
include/boost/fusion/iterator/value_of.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
Use, modification and distribution is subject to 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_VALUE_OF_05052005_1126)
|
||||
#define FUSION_VALUE_OF_05052005_1126
|
||||
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_of_impl
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct apply {};
|
||||
};
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct value_of
|
||||
: extension::value_of_impl<typename detail::tag_of<Iterator>::type>::
|
||||
template apply<Iterator>
|
||||
{};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user