diff options
Diffstat (limited to '3rdParty/Boost/src/boost/fusion/algorithm/transformation')
11 files changed, 539 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/erase.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/erase.hpp new file mode 100644 index 0000000..d0405c3 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/erase.hpp @@ -0,0 +1,108 @@ +/*============================================================================= + 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/iterator/equal_to.hpp> +#include <boost/fusion/iterator/mpl/convert_iterator.hpp> +#include <boost/fusion/container/vector/vector10.hpp> +#include <boost/fusion/view/joint_view/joint_view.hpp> +#include <boost/fusion/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/adapted/mpl/mpl_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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/erase_key.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/erase_key.hpp new file mode 100644 index 0000000..0312869 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/erase_key.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + 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/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 + : erase<Sequence, typename find<Sequence, Key>::type> + {}; + } + + template <typename Key, typename Sequence> + inline typename result_of::erase_key<Sequence const, Key>::type + erase_key(Sequence const& seq) + { + return erase(seq, find<Key>(seq)); + } +}} + +#endif + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/filter_if.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/filter_if.hpp new file mode 100644 index 0000000..d13113b --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/filter_if.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + 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/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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/insert.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/insert.hpp new file mode 100644 index 0000000..1702bc1 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/insert.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + 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/support/detail/as_fusion_element.hpp> +#include <boost/fusion/iterator/mpl/convert_iterator.hpp> +#include <boost/fusion/container/vector/vector10.hpp> +#include <boost/fusion/view/joint_view/joint_view.hpp> +#include <boost/fusion/view/single_view/single_view.hpp> +#include <boost/fusion/view/iterator_range/iterator_range.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/sequence/intrinsic/end.hpp> +#include <boost/fusion/adapted/mpl/mpl_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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/insert_range.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/insert_range.hpp new file mode 100644 index 0000000..1915c41 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/insert_range.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + 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/iterator/mpl/convert_iterator.hpp> +#include <boost/fusion/container/vector/vector10.hpp> +#include <boost/fusion/view/joint_view/joint_view.hpp> +#include <boost/fusion/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/adapted/mpl/mpl_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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/pop_back.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/pop_back.hpp new file mode 100644 index 0000000..6eb743f --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/pop_back.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + 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/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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/pop_front.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/pop_front.hpp new file mode 100644 index 0000000..aed524d --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/pop_front.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + 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/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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/push_back.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/push_back.hpp new file mode 100644 index 0000000..4fadc79 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/push_back.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + 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/view/joint_view/joint_view.hpp> +#include <boost/fusion/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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/push_front.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/push_front.hpp new file mode 100644 index 0000000..10f9fc1 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/push_front.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + 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/view/joint_view/joint_view.hpp> +#include <boost/fusion/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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/reverse.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/reverse.hpp new file mode 100644 index 0000000..b95461c --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/reverse.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + 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/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 + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/transformation/transform.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/transform.hpp new file mode 100644 index 0000000..681319b --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/transformation/transform.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + 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/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> +#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) + struct transform<Sequence, F, void_> +#else + struct transform<Sequence, F> +#endif + { + 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 + |