forked from boostorg/fusion
Removed file/folder
[SVN r40230]
This commit is contained in:
@ -1,32 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_CLEAR_09172005_1127)
|
||||
#define FUSION_CLEAR_09172005_1127
|
||||
|
||||
#include <boost/fusion/sequence/container/vector/vector10.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct clear
|
||||
{
|
||||
typedef vector0 type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
inline typename result_of::clear<Sequence const>::type
|
||||
clear(Sequence const& seq)
|
||||
{
|
||||
return vector0();
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,73 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_REPLACE_08182005_0841)
|
||||
#define FUSION_REPLACE_08182005_0841
|
||||
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
template <bool is_convertible>
|
||||
struct replacer_helper;
|
||||
|
||||
template <>
|
||||
struct replacer_helper<false>
|
||||
{
|
||||
template <typename U, typename T>
|
||||
static U&
|
||||
call(U& x, T const&, T const&)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct replacer_helper<true>
|
||||
{
|
||||
template <typename U, typename T>
|
||||
static U
|
||||
call(U& x, T const& old_value, T const& new_value)
|
||||
{
|
||||
return (x == old_value) ? new_value : x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct replacer
|
||||
{
|
||||
replacer(T const& old_value, T const& new_value)
|
||||
: old_value(old_value), new_value(new_value) {}
|
||||
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template <typename U1, typename U2>
|
||||
struct result<replacer<U1>(U2)>
|
||||
{
|
||||
typedef typename remove_reference<U2>::type value;
|
||||
typedef typename
|
||||
mpl::if_<is_convertible<T, value>, value, value const&>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename U>
|
||||
typename result<replacer(U)>::type
|
||||
operator()(U const& x) const
|
||||
{
|
||||
return replacer_helper<is_convertible<T, U>::value>::
|
||||
call(x, old_value, new_value);
|
||||
}
|
||||
|
||||
T old_value;
|
||||
T new_value;
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
@ -1,73 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_REPLACE_IF_08182005_0946)
|
||||
#define FUSION_REPLACE_IF_08182005_0946
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
template <bool is_convertible>
|
||||
struct replacer_if_helper;
|
||||
|
||||
template <>
|
||||
struct replacer_if_helper<false>
|
||||
{
|
||||
template <typename U, typename F, typename T>
|
||||
static U&
|
||||
call(U& x, F&, T const&)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct replacer_if_helper<true>
|
||||
{
|
||||
template <typename U, typename F, typename T>
|
||||
static U
|
||||
call(U& x, F& f, T const& new_value)
|
||||
{
|
||||
return f(x) ? new_value : x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename F, typename T>
|
||||
struct replacer_if
|
||||
{
|
||||
replacer_if(F f, T const& new_value)
|
||||
: f(f), new_value(new_value) {}
|
||||
|
||||
template<typename Params>
|
||||
struct result;
|
||||
|
||||
template <typename F1, typename T1, typename U>
|
||||
struct result<replacer_if<F1, T1>(U)>
|
||||
{
|
||||
typedef typename remove_reference<U>::type value;
|
||||
typedef typename
|
||||
mpl::if_<is_convertible<T, value>, value, value const&>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename U>
|
||||
typename result<replacer_if(U)>::type
|
||||
operator()(U const& x) const
|
||||
{
|
||||
return replacer_if_helper<is_convertible<T, U>::value>::
|
||||
call(x, f, new_value);
|
||||
}
|
||||
|
||||
F f;
|
||||
T new_value;
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
@ -1,107 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_ERASE_07232005_0534)
|
||||
#define FUSION_ERASE_07232005_0534
|
||||
|
||||
#include <boost/fusion/sequence/container/vector/vector10.hpp>
|
||||
#include <boost/fusion/sequence/view/joint_view/joint_view.hpp>
|
||||
#include <boost/fusion/sequence/view/iterator_range/iterator_range.hpp>
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename First>
|
||||
struct compute_erase_last // put this in detail!!!
|
||||
{
|
||||
typedef typename result_of::end<Sequence>::type seq_last_type;
|
||||
typedef typename convert_iterator<First>::type first_type;
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
result_of::equal_to<first_type, seq_last_type>
|
||||
, first_type
|
||||
, typename result_of::next<first_type>::type
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(First const& first, mpl::false_)
|
||||
{
|
||||
return fusion::next(convert_iterator<First>::call(first));
|
||||
}
|
||||
|
||||
static type
|
||||
call(First const& first, mpl::true_)
|
||||
{
|
||||
return convert_iterator<First>::call(first);
|
||||
}
|
||||
|
||||
static type
|
||||
call(First const& first)
|
||||
{
|
||||
return call(first, result_of::equal_to<first_type, seq_last_type>());
|
||||
}
|
||||
};
|
||||
|
||||
template <
|
||||
typename Sequence
|
||||
, typename First
|
||||
, typename Last = typename compute_erase_last<Sequence, First>::type>
|
||||
struct erase
|
||||
{
|
||||
typedef typename result_of::begin<Sequence>::type seq_first_type;
|
||||
typedef typename result_of::end<Sequence>::type seq_last_type;
|
||||
BOOST_STATIC_ASSERT((!result_of::equal_to<seq_first_type, seq_last_type>::value));
|
||||
|
||||
typedef typename convert_iterator<First>::type first_type;
|
||||
typedef typename convert_iterator<Last>::type last_type;
|
||||
typedef iterator_range<seq_first_type, first_type> left_type;
|
||||
typedef iterator_range<last_type, seq_last_type> right_type;
|
||||
typedef joint_view<left_type, right_type> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename First>
|
||||
typename result_of::erase<Sequence const, First>::type
|
||||
erase(Sequence const& seq, First const& first)
|
||||
{
|
||||
typedef result_of::erase<Sequence const, First> result_of;
|
||||
typedef typename result_of::left_type left_type;
|
||||
typedef typename result_of::right_type right_type;
|
||||
typedef typename result_of::type result_type;
|
||||
|
||||
left_type left(
|
||||
fusion::begin(seq)
|
||||
, convert_iterator<First>::call(first));
|
||||
right_type right(
|
||||
fusion::result_of::compute_erase_last<Sequence const, First>::call(first)
|
||||
, fusion::end(seq));
|
||||
return result_type(left, right);
|
||||
}
|
||||
|
||||
template <typename Sequence, typename First, typename Last>
|
||||
typename result_of::erase<Sequence const, First, Last>::type
|
||||
erase(Sequence const& seq, First const& first, Last const& last)
|
||||
{
|
||||
typedef result_of::erase<Sequence const, First, Last> result_of;
|
||||
typedef typename result_of::left_type left_type;
|
||||
typedef typename result_of::right_type right_type;
|
||||
typedef typename result_of::type result_type;
|
||||
|
||||
left_type left(fusion::begin(seq), first);
|
||||
right_type right(last, fusion::end(seq));
|
||||
return result_type(left, right);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_ERASE_KEY_10022005_1851)
|
||||
#define FUSION_ERASE_KEY_10022005_1851
|
||||
|
||||
#include <boost/fusion/algorithm/query/detail/assoc_find.hpp>
|
||||
#include <boost/fusion/algorithm/transformation/erase.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename Key>
|
||||
struct erase_key
|
||||
{
|
||||
typedef detail::assoc_find<Sequence, Key> filter;
|
||||
typedef typename erase<Sequence, typename filter::type>::type type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Key, typename Sequence>
|
||||
inline typename result_of::erase_key<Sequence const, Key>::type
|
||||
erase_key(Sequence const& seq)
|
||||
{
|
||||
typedef typename result_of::erase_key<Sequence const, Key>::filter filter;
|
||||
return erase(seq, filter::call(seq));
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,34 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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_FILTER_02122005_1839)
|
||||
#define FUSION_FILTER_02122005_1839
|
||||
|
||||
#include <boost/fusion/sequence/view/filter_view/filter_view.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename T>
|
||||
struct filter
|
||||
{
|
||||
typedef filter_view<Sequence, is_same<mpl::_, T> > type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename T, typename Sequence>
|
||||
inline typename result_of::filter<Sequence const, T>::type
|
||||
filter(Sequence const& seq)
|
||||
{
|
||||
return filter_view<const Sequence, is_same<mpl::_, T> >(seq);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,32 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_FILTER_IF_07172005_0818)
|
||||
#define FUSION_FILTER_IF_07172005_0818
|
||||
|
||||
#include <boost/fusion/sequence/view/filter_view/filter_view.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename Pred>
|
||||
struct filter_if
|
||||
{
|
||||
typedef filter_view<Sequence, Pred> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Pred, typename Sequence>
|
||||
inline typename result_of::filter_if<Sequence const, Pred>::type
|
||||
filter_if(Sequence const& seq)
|
||||
{
|
||||
return filter_view<Sequence const, Pred>(seq);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,62 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_INSERT_07222005_0730)
|
||||
#define FUSION_INSERT_07222005_0730
|
||||
|
||||
#include <boost/fusion/sequence/container/vector/vector10.hpp>
|
||||
#include <boost/fusion/sequence/view/joint_view/joint_view.hpp>
|
||||
#include <boost/fusion/sequence/view/single_view/single_view.hpp>
|
||||
#include <boost/fusion/sequence/view/iterator_range/iterator_range.hpp>
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename Position, typename T>
|
||||
struct insert
|
||||
{
|
||||
typedef typename detail::as_fusion_element<T>::type element_type;
|
||||
typedef typename convert_iterator<Position>::type pos_type;
|
||||
typedef typename result_of::begin<Sequence>::type first_type;
|
||||
typedef typename result_of::end<Sequence>::type last_type;
|
||||
|
||||
typedef iterator_range<first_type, pos_type> left_type;
|
||||
typedef iterator_range<pos_type, last_type> right_type;
|
||||
typedef fusion::single_view<element_type> single_view;
|
||||
typedef joint_view<left_type, single_view const> left_insert_type;
|
||||
typedef joint_view<left_insert_type, right_type> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename Position, typename T>
|
||||
inline typename result_of::insert<
|
||||
Sequence const, Position, T>::type
|
||||
insert(Sequence const& seq, Position const& pos, T const& x)
|
||||
{
|
||||
typedef result_of::insert<
|
||||
Sequence const, Position, T>
|
||||
result_of;
|
||||
typedef typename result_of::left_type left_type;
|
||||
typedef typename result_of::right_type right_type;
|
||||
typedef typename result_of::single_view single_view;
|
||||
typedef typename result_of::left_insert_type left_insert_type;
|
||||
typedef typename result_of::type result;
|
||||
|
||||
left_type left(fusion::begin(seq), convert_iterator<Position>::call(pos));
|
||||
right_type right(convert_iterator<Position>::call(pos), fusion::end(seq));
|
||||
single_view insert(x);
|
||||
left_insert_type left_insert(left, insert);
|
||||
return result(left_insert, right);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,54 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_INSERT_RANGE_009172005_1147)
|
||||
#define FUSION_INSERT_RANGE_009172005_1147
|
||||
|
||||
#include <boost/fusion/sequence/container/vector/vector10.hpp>
|
||||
#include <boost/fusion/sequence/view/joint_view/joint_view.hpp>
|
||||
#include <boost/fusion/sequence/view/iterator_range/iterator_range.hpp>
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename Position, typename Range>
|
||||
struct insert_range
|
||||
{
|
||||
typedef typename convert_iterator<Position>::type pos_type;
|
||||
typedef typename result_of::begin<Sequence>::type first_type;
|
||||
typedef typename result_of::end<Sequence>::type last_type;
|
||||
|
||||
typedef iterator_range<first_type, pos_type> left_type;
|
||||
typedef iterator_range<pos_type, last_type> right_type;
|
||||
typedef joint_view<left_type, Range> left_insert_type;
|
||||
typedef joint_view<left_insert_type, right_type> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename Position, typename Range>
|
||||
inline typename result_of::insert_range<Sequence const, Position, Range const>::type
|
||||
insert_range(Sequence const& seq, Position const& pos, Range const& range)
|
||||
{
|
||||
typedef result_of::insert_range<Sequence const, Position, Range const> result_of;
|
||||
typedef typename result_of::left_type left_type;
|
||||
typedef typename result_of::right_type right_type;
|
||||
typedef typename result_of::left_insert_type left_insert_type;
|
||||
typedef typename result_of::type result;
|
||||
|
||||
left_type left(fusion::begin(seq), convert_iterator<Position>::call(pos));
|
||||
right_type right(convert_iterator<Position>::call(pos), fusion::end(seq));
|
||||
left_insert_type left_insert(left, range);
|
||||
return result(left_insert, right);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,33 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2006 Dan Marsden
|
||||
|
||||
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_JOIN_200601222109)
|
||||
#define FUSION_JOIN_200601222109
|
||||
|
||||
#include <boost/fusion/sequence/view/joint_view.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template<typename LhSequence, typename RhSequence>
|
||||
struct join
|
||||
{
|
||||
typedef joint_view<LhSequence, RhSequence> type;
|
||||
};
|
||||
}
|
||||
|
||||
template<typename LhSequence, typename RhSequence>
|
||||
inline typename result_of::join<LhSequence const, RhSequence const>::type
|
||||
join(LhSequence const& lhs, RhSequence const& rhs)
|
||||
{
|
||||
return typename result_of::join<LhSequence const, RhSequence const>::type(
|
||||
lhs, rhs);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,43 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_POP_BACK_09172005_1038)
|
||||
#define FUSION_POP_BACK_09172005_1038
|
||||
|
||||
#include <boost/fusion/sequence/view/iterator_range/iterator_range.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct pop_back
|
||||
{
|
||||
typedef
|
||||
iterator_range<
|
||||
typename begin<Sequence>::type
|
||||
, typename prior<
|
||||
typename end<Sequence>::type
|
||||
>::type
|
||||
>
|
||||
type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
inline typename result_of::pop_back<Sequence const>::type
|
||||
pop_back(Sequence const& seq)
|
||||
{
|
||||
typedef typename result_of::pop_back<Sequence const>::type result;
|
||||
return result(fusion::begin(seq), fusion::prior(fusion::end(seq)));
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_POP_FRONT_09172005_1115)
|
||||
#define FUSION_POP_FRONT_09172005_1115
|
||||
|
||||
#include <boost/fusion/sequence/view/iterator_range/iterator_range.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct pop_front
|
||||
{
|
||||
typedef
|
||||
iterator_range<
|
||||
typename next<
|
||||
typename begin<Sequence>::type
|
||||
>::type
|
||||
, typename end<Sequence>::type
|
||||
>
|
||||
type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
inline typename result_of::pop_front<Sequence const>::type
|
||||
pop_front(Sequence const& seq)
|
||||
{
|
||||
typedef typename result_of::pop_front<Sequence const>::type result;
|
||||
return result(fusion::next(fusion::begin(seq)), fusion::end(seq));
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,39 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_PUSH_BACK_07162005_0235)
|
||||
#define FUSION_PUSH_BACK_07162005_0235
|
||||
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
#include <boost/fusion/sequence/view/joint_view/joint_view.hpp>
|
||||
#include <boost/fusion/sequence/view/single_view/single_view.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename T>
|
||||
struct push_back
|
||||
{
|
||||
typedef fusion::single_view<typename detail::as_fusion_element<T>::type> single_view;
|
||||
typedef joint_view<Sequence, single_view const> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename T>
|
||||
inline typename result_of::push_back<Sequence const, T>::type
|
||||
push_back(Sequence const& seq, T const& x)
|
||||
{
|
||||
typedef typename result_of::push_back<Sequence const, T> push_back;
|
||||
typedef typename push_back::single_view single_view;
|
||||
typedef typename push_back::type result;
|
||||
single_view x_(x);
|
||||
return result(seq, x_);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,39 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_PUSH_FRONT_07162005_0749)
|
||||
#define FUSION_PUSH_FRONT_07162005_0749
|
||||
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
#include <boost/fusion/sequence/view/joint_view/joint_view.hpp>
|
||||
#include <boost/fusion/sequence/view/single_view/single_view.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename T>
|
||||
struct push_front
|
||||
{
|
||||
typedef fusion::single_view<typename detail::as_fusion_element<T>::type> single_view;
|
||||
typedef joint_view<single_view const, Sequence> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename T>
|
||||
inline typename result_of::push_front<Sequence const, T>::type
|
||||
push_front(Sequence const& seq, T const& x)
|
||||
{
|
||||
typedef typename result_of::push_front<Sequence const, T> push_front;
|
||||
typedef typename push_front::single_view single_view;
|
||||
typedef typename push_front::type result;
|
||||
single_view x_(x);
|
||||
return result(x_, seq);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_REMOVE_07162005_0818)
|
||||
#define FUSION_REMOVE_07162005_0818
|
||||
|
||||
#include <boost/fusion/sequence/view/filter_view/filter_view.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename T>
|
||||
struct remove
|
||||
{
|
||||
typedef filter_view<Sequence, mpl::not_<is_same<mpl::_, T> > > type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename T, typename Sequence>
|
||||
inline typename result_of::remove<Sequence const, T>::type
|
||||
remove(Sequence const& seq)
|
||||
{
|
||||
typedef typename result_of::remove<Sequence const, T>::type result_type;
|
||||
return result_type(seq);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_REMOVE_IF_07162005_0818)
|
||||
#define FUSION_REMOVE_IF_07162005_0818
|
||||
|
||||
#include <boost/fusion/sequence/view/filter_view/filter_view.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename Pred>
|
||||
struct remove_if
|
||||
{
|
||||
typedef filter_view<Sequence, mpl::not_<Pred> > type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Pred, typename Sequence>
|
||||
inline typename result_of::remove_if<Sequence const, Pred>::type
|
||||
remove_if(Sequence const& seq)
|
||||
{
|
||||
typedef typename result_of::remove_if<Sequence const, Pred>::type result_type;
|
||||
return result_type(seq);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_REPLACE_08182005_0830)
|
||||
#define FUSION_REPLACE_08182005_0830
|
||||
|
||||
#include <boost/fusion/sequence/view/transform_view/transform_view.hpp>
|
||||
#include <boost/fusion/algorithm/transformation/detail/replace.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename T>
|
||||
struct replace
|
||||
{
|
||||
typedef transform_view<Sequence, detail::replacer<T> > type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename T>
|
||||
inline typename result_of::replace<Sequence const, T>::type
|
||||
replace(Sequence const& seq, T const& old_value, T const& new_value)
|
||||
{
|
||||
typedef typename result_of::replace<Sequence const, T>::type result;
|
||||
detail::replacer<T> f(old_value, new_value);
|
||||
return result(seq, f);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_REPLACE_IF_08182005_0939)
|
||||
#define FUSION_REPLACE_IF_08182005_0939
|
||||
|
||||
#include <boost/fusion/sequence/view/transform_view/transform_view.hpp>
|
||||
#include <boost/fusion/algorithm/transformation/detail/replace_if.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename F, typename T>
|
||||
struct replace_if
|
||||
{
|
||||
typedef transform_view<Sequence, detail::replacer_if<F, T> > type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename F, typename T>
|
||||
inline typename result_of::replace_if<Sequence const, F, T>::type
|
||||
replace_if(Sequence const& seq, F pred, T const& new_value)
|
||||
{
|
||||
typedef typename result_of::replace_if<Sequence const, F, T>::type result;
|
||||
detail::replacer_if<F, T> f(pred, new_value);
|
||||
return result(seq, f);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,32 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_REVERSE_07212005_1230)
|
||||
#define FUSION_REVERSE_07212005_1230
|
||||
|
||||
#include <boost/fusion/sequence/view/reverse_view/reverse_view.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct reverse
|
||||
{
|
||||
typedef reverse_view<Sequence> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
inline reverse_view<Sequence const>
|
||||
reverse(Sequence const& view)
|
||||
{
|
||||
return reverse_view<Sequence const>(view);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,47 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_TRANSFORM_07052005_1057)
|
||||
#define FUSION_TRANSFORM_07052005_1057
|
||||
|
||||
#include <boost/fusion/sequence/view/transform_view/transform_view.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence1, typename Sequence2, typename F = void_>
|
||||
struct transform
|
||||
{
|
||||
typedef transform_view<Sequence1, Sequence2, F> type;
|
||||
};
|
||||
|
||||
template <typename Sequence, typename F>
|
||||
struct transform<Sequence, F>
|
||||
{
|
||||
typedef transform_view<Sequence, F> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename F>
|
||||
inline typename result_of::transform<Sequence const, F>::type
|
||||
transform(Sequence const& seq, F f)
|
||||
{
|
||||
return transform_view<Sequence const, F>(seq, f);
|
||||
}
|
||||
|
||||
template <typename Sequence1, typename Sequence2, typename F>
|
||||
inline typename result_of::transform<Sequence1 const, Sequence2 const, F>::type
|
||||
transform(Sequence1 const& seq1, Sequence2 const& seq2, F f)
|
||||
{
|
||||
return transform_view<Sequence1 const, Sequence2 const, F>(seq1, seq2, f);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
@ -1,79 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2006 Dan Marsden
|
||||
|
||||
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_PP_IS_ITERATING
|
||||
#if !defined(FUSION_ZIP_HPP_20060125_2058)
|
||||
#define FUSION_ZIP_HPP_20060125_2058
|
||||
|
||||
#include <boost/fusion/sequence/view/zip_view.hpp>
|
||||
#include <boost/fusion/sequence/adapted/mpl.hpp>
|
||||
#include <boost/fusion/sequence/container/vector.hpp>
|
||||
#include <boost/fusion/sequence/conversion/as_vector.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
#include <boost/mpl/transform.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
#if !defined(FUSION_MAX_ZIP_SEQUENCES)
|
||||
#define FUSION_MAX_ZIP_SEQUENCES 10
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct void_;
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_INC(FUSION_MAX_ZIP_SEQUENCES), typename T, fusion::void_)>
|
||||
struct zip;
|
||||
}
|
||||
|
||||
#define BOOST_PP_FILENAME_1 \
|
||||
<boost/fusion/algorithm/transformation/zip.hpp>
|
||||
#define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_ZIP_SEQUENCES)
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define ZIP_ITERATION BOOST_PP_ITERATION()
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T) >
|
||||
struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) >
|
||||
{
|
||||
typedef mpl::vector< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > sequences;
|
||||
typedef typename mpl::transform<sequences, add_reference<mpl::_> >::type ref_params;
|
||||
typedef zip_view<typename result_of::as_vector<ref_params>::type> type;
|
||||
};
|
||||
}
|
||||
|
||||
#define FUSION_REF_PARAM(z, n, data) const T ## n&
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T)>
|
||||
inline typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type
|
||||
zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t))
|
||||
{
|
||||
fusion::vector<BOOST_PP_ENUM(ZIP_ITERATION, FUSION_REF_PARAM, _)> seqs(
|
||||
BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, t));
|
||||
return typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type(
|
||||
seqs);
|
||||
}
|
||||
|
||||
#undef FUSION_REF_PARAM
|
||||
#undef ZIP_ITERATION
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user