bug fixes to segmented fusion support, more fwd headers

[SVN r73927]
This commit is contained in:
Eric Niebler
2011-08-19 18:41:11 +00:00
parent eb903d71a7
commit def510808d
18 changed files with 286 additions and 22 deletions

View File

@ -10,6 +10,10 @@
#include <boost/fusion/sequence/intrinsic_fwd.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/deref_data.hpp>
#include <boost/fusion/iterator/key_of.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/value_of_data.hpp>
#include <boost/fusion/iterator/detail/segmented_equal_to.hpp>
#include <boost/fusion/container/list/detail/reverse_cons.hpp>
@ -26,7 +30,7 @@ namespace boost { namespace fusion
// A segmented iterator wraps a "context", which is a cons list
// of ranges, the frontmost is range over values and the rest
// are ranges over internal segments.
template<typename Context>
template <typename Context>
struct segmented_iterator
: iterator_facade<segmented_iterator<Context>, forward_traversal_tag>
{
@ -38,7 +42,7 @@ namespace boost { namespace fusion
//{
// return deref(begin(car(it.context)))
//}
template<typename It>
template <typename It>
struct deref
{
typedef
@ -53,9 +57,70 @@ namespace boost { namespace fusion
}
};
//auto deref_data(it)
//{
// return deref_data(begin(car(it.context)))
//}
template <typename It>
struct deref_data
{
typedef
typename result_of::deref_data<
typename It::context_type::car_type::begin_type
>::type
type;
static type call(It const& it)
{
return fusion::deref_data(it.context.car.first);
}
};
//auto key_of(it)
//{
// return key_of(begin(car(it.context)))
//}
template <typename It>
struct key_of
{
typedef
typename result_of::key_of<
typename It::context_type::car_type::begin_type
>::type
type;
};
//auto value_of(it)
//{
// return value_of(begin(car(it.context)))
//}
template <typename It>
struct value_of
{
typedef
typename result_of::value_of<
typename It::context_type::car_type::begin_type
>::type
type;
};
//auto value_of_data(it)
//{
// return value_of_data(begin(car(it.context)))
//}
template <typename It>
struct value_of_data
{
typedef
typename result_of::value_of_data<
typename It::context_type::car_type::begin_type
>::type
type;
};
// Compare all the segment iterators in each stack, starting with
// the bottom-most.
template<typename It1, typename It2>
template <typename It1, typename It2>
struct equal_to
: detail::segmented_equal_to<
typename detail::reverse_cons<typename It1::context_type>::type,
@ -63,7 +128,7 @@ namespace boost { namespace fusion
>
{};
template<typename It>
template <typename It>
struct next
{
typedef detail::segmented_next_impl<typename It::context_type> impl;