forked from boostorg/fusion
associative iterators & views
[SVN r57156]
This commit is contained in:
@@ -11,7 +11,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_tag;
|
||||
|
||||
template <typename First, typename Last, typename Pred>
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator;
|
||||
|
||||
namespace extension
|
||||
@@ -28,7 +28,8 @@ namespace boost { namespace fusion
|
||||
typedef typename Sequence::first_type first_type;
|
||||
typedef typename Sequence::last_type last_type;
|
||||
typedef typename Sequence::pred_type pred_type;
|
||||
typedef filter_iterator<first_type, last_type, pred_type> type;
|
||||
typedef typename Sequence::category category;
|
||||
typedef filter_iterator<category, first_type, last_type, pred_type> type;
|
||||
|
||||
static type
|
||||
call(Sequence& s)
|
||||
|
@@ -0,0 +1,37 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/deref_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct deref_data_impl;
|
||||
|
||||
template <>
|
||||
struct deref_data_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref_data<typename It::first_type>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(It const& it)
|
||||
{
|
||||
return fusion::deref_data(it.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -11,7 +11,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_tag;
|
||||
|
||||
template <typename First, typename Last, typename Pred>
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator;
|
||||
|
||||
namespace extension
|
||||
@@ -27,7 +27,8 @@ namespace boost { namespace fusion
|
||||
{
|
||||
typedef typename Sequence::last_type last_type;
|
||||
typedef typename Sequence::pred_type pred_type;
|
||||
typedef filter_iterator<last_type, last_type, pred_type> type;
|
||||
typedef typename Sequence::category category;
|
||||
typedef filter_iterator<category,last_type, last_type, pred_type> type;
|
||||
|
||||
static type
|
||||
call(Sequence& s)
|
||||
|
28
include/boost/fusion/view/filter_view/detail/key_of_impl.hpp
Normal file
28
include/boost/fusion/view/filter_view/detail/key_of_impl.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/key_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct key_of_impl;
|
||||
|
||||
template <>
|
||||
struct key_of_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::key_of<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -8,14 +8,19 @@
|
||||
#define FUSION_NEXT_IMPL_06052005_0900
|
||||
|
||||
#include <boost/fusion/algorithm/query/detail/find_if.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
#include <boost/mpl/quote.hpp>
|
||||
#include <boost/mpl/bind.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_iterator_tag;
|
||||
|
||||
template <typename First, typename Last, typename Pred>
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator;
|
||||
|
||||
namespace extension
|
||||
@@ -32,6 +37,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::last_type last_type;
|
||||
typedef typename Iterator::pred_type pred_type;
|
||||
typedef typename Iterator::category category;
|
||||
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
@@ -41,12 +47,19 @@ namespace boost { namespace fusion
|
||||
>::type
|
||||
next_type;
|
||||
|
||||
typedef typename detail::static_find_if<
|
||||
next_type, last_type, pred_type>
|
||||
typedef typename
|
||||
detail::static_find_if<
|
||||
next_type
|
||||
, last_type
|
||||
, mpl::bind1<
|
||||
typename mpl::lambda<pred_type>::type
|
||||
, mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1>
|
||||
>
|
||||
>
|
||||
filter;
|
||||
|
||||
typedef filter_iterator<
|
||||
typename filter::type, last_type, pred_type>
|
||||
category, typename filter::type, last_type, pred_type>
|
||||
type;
|
||||
|
||||
static type
|
||||
|
@@ -0,0 +1,28 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/value_of_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct value_of_data_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_data_impl<filter_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::value_of_data<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -17,6 +17,10 @@
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/inherit.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
@@ -29,7 +33,13 @@ namespace boost { namespace fusion
|
||||
{
|
||||
typedef filter_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef forward_traversal_tag category;
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
traits::is_associative<Sequence>
|
||||
, mpl::inherit2<forward_traversal_tag,associative_sequence_tag>
|
||||
, mpl::identity<forward_traversal_tag>
|
||||
>::type
|
||||
category;
|
||||
typedef mpl::true_ is_view;
|
||||
|
||||
typedef typename result_of::begin<Sequence>::type first_type;
|
||||
|
@@ -9,20 +9,29 @@
|
||||
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/fusion/iterator/value_of.hpp>
|
||||
#include <boost/fusion/support/iterator_base.hpp>
|
||||
#include <boost/fusion/algorithm/query/detail/find_if.hpp>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
#include <boost/mpl/quote.hpp>
|
||||
#include <boost/mpl/bind.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
#include <boost/fusion/view/filter_view/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/next_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/equal_to_impl.hpp>
|
||||
#include <boost/fusion/algorithm/query/detail/find_if.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/deref_data_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/view/filter_view/detail/key_of_impl.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct filter_view_iterator_tag;
|
||||
struct forward_traversal_tag;
|
||||
|
||||
template <typename First, typename Last, typename Pred>
|
||||
struct filter_iterator : iterator_base<filter_iterator<First, Last, Pred> >
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct filter_iterator : iterator_base<filter_iterator<Category, First, Last, Pred> >
|
||||
{
|
||||
typedef convert_iterator<First> first_converter;
|
||||
typedef typename first_converter::type first_iter;
|
||||
@@ -30,8 +39,17 @@ namespace boost { namespace fusion
|
||||
typedef typename last_converter::type last_iter;
|
||||
|
||||
typedef filter_view_iterator_tag fusion_tag;
|
||||
typedef forward_traversal_tag category;
|
||||
typedef detail::static_find_if<first_iter, last_iter, Pred> filter;
|
||||
typedef Category category;
|
||||
typedef
|
||||
detail::static_find_if<
|
||||
first_iter
|
||||
, last_iter
|
||||
, mpl::bind1<
|
||||
typename mpl::lambda<Pred>::type
|
||||
, mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1>
|
||||
>
|
||||
>
|
||||
filter;
|
||||
typedef typename filter::type first_type;
|
||||
typedef last_iter last_type;
|
||||
typedef Pred pred_type;
|
||||
|
@@ -17,7 +17,6 @@
|
||||
#include <boost/fusion/view/iterator_range/detail/at_impl.hpp>
|
||||
#include <boost/fusion/view/iterator_range/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
|
@@ -14,7 +14,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_tag;
|
||||
|
||||
template <typename First, typename Last, typename Concat>
|
||||
template <typename Category, typename First, typename Last, typename Concat>
|
||||
struct joint_view_iterator;
|
||||
|
||||
namespace extension
|
||||
@@ -31,13 +31,14 @@ namespace boost { namespace fusion
|
||||
typedef typename Sequence::first_type first_type;
|
||||
typedef typename Sequence::last_type last_type;
|
||||
typedef typename Sequence::concat_type concat_type;
|
||||
typedef typename Sequence::category category;
|
||||
typedef result_of::equal_to<first_type, last_type> equal_to;
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
equal_to
|
||||
, concat_type
|
||||
, joint_view_iterator<first_type, last_type, concat_type>
|
||||
, joint_view_iterator<category, first_type, last_type, concat_type>
|
||||
>::type
|
||||
type;
|
||||
|
||||
|
@@ -0,0 +1,37 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/deref_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct deref_data_impl;
|
||||
|
||||
template <>
|
||||
struct deref_data_impl<joint_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref_data<typename It::first_type>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(It const& it)
|
||||
{
|
||||
return fusion::deref_data(it.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
28
include/boost/fusion/view/joint_view/detail/key_of_impl.hpp
Normal file
28
include/boost/fusion/view/joint_view/detail/key_of_impl.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/key_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct key_of_impl;
|
||||
|
||||
template <>
|
||||
struct key_of_impl<joint_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::key_of<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -15,7 +15,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
struct joint_view_iterator_tag;
|
||||
|
||||
template <typename First, typename Last, typename Concat>
|
||||
template <typename Category, typename First, typename Last, typename Concat>
|
||||
struct joint_view_iterator;
|
||||
|
||||
namespace extension
|
||||
@@ -32,6 +32,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::first_type first_type;
|
||||
typedef typename Iterator::last_type last_type;
|
||||
typedef typename Iterator::concat_type concat_type;
|
||||
typedef typename Iterator::category category;
|
||||
typedef typename result_of::next<first_type>::type next_type;
|
||||
typedef result_of::equal_to<next_type, last_type> equal_to;
|
||||
|
||||
@@ -39,7 +40,7 @@ namespace boost { namespace fusion
|
||||
mpl::if_<
|
||||
equal_to
|
||||
, concat_type
|
||||
, joint_view_iterator<next_type, last_type, concat_type>
|
||||
, joint_view_iterator<category, next_type, last_type, concat_type>
|
||||
>::type
|
||||
type;
|
||||
|
||||
|
@@ -0,0 +1,28 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/value_of_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct value_of_data_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_data_impl<joint_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::value_of_data<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -19,6 +19,9 @@
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/plus.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/inherit.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
@@ -31,7 +34,16 @@ namespace boost { namespace fusion
|
||||
{
|
||||
typedef joint_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef forward_traversal_tag category;
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
mpl::and_<
|
||||
traits::is_associative<Sequence1>
|
||||
, traits::is_associative<Sequence2>
|
||||
>
|
||||
, mpl::inherit2<forward_traversal_tag,associative_sequence_tag>
|
||||
, mpl::identity<forward_traversal_tag>
|
||||
>::type
|
||||
category;
|
||||
typedef mpl::true_ is_view;
|
||||
|
||||
typedef typename result_of::begin<Sequence1>::type first_type;
|
||||
|
@@ -14,6 +14,9 @@
|
||||
#include <boost/fusion/view/joint_view/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/next_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/deref_data_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/view/joint_view/detail/key_of_impl.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
@@ -21,9 +24,9 @@ namespace boost { namespace fusion
|
||||
struct joint_view_iterator_tag;
|
||||
struct forward_traversal_tag;
|
||||
|
||||
template <typename First, typename Last, typename Concat>
|
||||
template <typename Category, typename First, typename Last, typename Concat>
|
||||
struct joint_view_iterator
|
||||
: iterator_base<joint_view_iterator<First, Last, Concat> >
|
||||
: iterator_base<joint_view_iterator<Category, First, Last, Concat> >
|
||||
{
|
||||
typedef convert_iterator<First> first_converter;
|
||||
typedef convert_iterator<Last> last_converter;
|
||||
@@ -34,7 +37,7 @@ namespace boost { namespace fusion
|
||||
typedef typename concat_converter::type concat_type;
|
||||
|
||||
typedef joint_view_iterator_tag fusion_tag;
|
||||
typedef forward_traversal_tag category;
|
||||
typedef Category category;
|
||||
BOOST_STATIC_ASSERT((!result_of::equal_to<first_type, last_type>::value));
|
||||
|
||||
joint_view_iterator(First const& first, Concat const& concat)
|
||||
|
@@ -0,0 +1,37 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/deref_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct deref_data_impl;
|
||||
|
||||
template <>
|
||||
struct deref_data_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref_data<typename It::first_type>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(It const& it)
|
||||
{
|
||||
return fusion::deref_data(it.first);
|
||||
}
|
||||
};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -0,0 +1,28 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_KEY_OF_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/key_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct key_of_impl;
|
||||
|
||||
template <>
|
||||
struct key_of_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::key_of<typename It::it_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -0,0 +1,28 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2009 Christopher Schmidt
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/iterator/value_of_data.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename>
|
||||
struct value_of_data_impl;
|
||||
|
||||
template <>
|
||||
struct value_of_data_impl<reverse_view_iterator_tag>
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: result_of::value_of_data<typename It::first_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -20,6 +20,9 @@
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/inherit.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
@@ -32,8 +35,15 @@ namespace boost { namespace fusion
|
||||
typedef reverse_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef mpl::true_ is_view;
|
||||
typedef typename traits::category_of<Sequence>::type seq_category;
|
||||
|
||||
typedef typename traits::category_of<Sequence>::type category;
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
traits::is_associative<Sequence>
|
||||
, mpl::inherit2<seq_category,associative_sequence_tag>
|
||||
, mpl::identity<seq_category>
|
||||
>::type
|
||||
category;
|
||||
typedef typename result_of::begin<Sequence>::type first_type;
|
||||
typedef typename result_of::end<Sequence>::type last_type;
|
||||
typedef typename result_of::size<Sequence>::type size;
|
||||
|
@@ -17,6 +17,9 @@
|
||||
#include <boost/fusion/view/reverse_view/detail/advance_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/distance_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/deref_data_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/view/reverse_view/detail/key_of_impl.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
|
Reference in New Issue
Block a user