forked from boostorg/fusion
baking segmented Fusion
[SVN r73854]
This commit is contained in:
@ -19,18 +19,14 @@
|
||||
#include <boost/fusion/container/vector/vector10.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/segments.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/detail/segmented_size.hpp>
|
||||
#include <boost/fusion/support/is_segmented.hpp>
|
||||
#include <boost/fusion/iterator/segmented_iterator.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/detail/segmented_end.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/segments.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct tree_tag;
|
||||
|
||||
template<typename Data, typename Left = nil, typename Right = nil>
|
||||
template <typename Data, typename Left = nil, typename Right = nil>
|
||||
struct tree
|
||||
: sequence_base<tree<Data, Left, Right> >
|
||||
{
|
||||
@ -38,7 +34,7 @@ namespace boost { namespace fusion
|
||||
typedef Left left_type;
|
||||
typedef Right right_type;
|
||||
typedef tree_tag fusion_tag;
|
||||
typedef bidirectional_traversal_tag category;
|
||||
typedef forward_traversal_tag category;
|
||||
typedef mpl::false_ is_view;
|
||||
|
||||
typedef typename mpl::if_<
|
||||
@ -59,13 +55,13 @@ namespace boost { namespace fusion
|
||||
segments_type segments;
|
||||
};
|
||||
|
||||
template<typename Data>
|
||||
template <typename Data>
|
||||
tree<Data> make_tree(Data const &data)
|
||||
{
|
||||
return tree<Data>(data);
|
||||
}
|
||||
|
||||
template<typename Data, typename Left, typename Right>
|
||||
template <typename Data, typename Left, typename Right>
|
||||
tree<Data, Left, Right> make_tree(Data const &data, Left const &left, Right const &right)
|
||||
{
|
||||
return tree<Data, Left, Right>(data, left, right);
|
||||
@ -73,17 +69,17 @@ namespace boost { namespace fusion
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<>
|
||||
template <>
|
||||
struct is_segmented_impl<tree_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
template <typename Sequence>
|
||||
struct apply : mpl::true_ {};
|
||||
};
|
||||
|
||||
template<>
|
||||
template <>
|
||||
struct segments_impl<tree_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
@ -98,33 +94,6 @@ namespace boost { namespace fusion
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct begin_impl<tree_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
: segmented_begin<Sequence>
|
||||
{};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct end_impl<tree_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
: segmented_end<Sequence>
|
||||
{};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct size_impl<tree_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
: segmented_size<Sequence>::type
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
|
Reference in New Issue
Block a user