diff options
Diffstat (limited to '3rdParty/Boost/src/boost/fusion/algorithm')
19 files changed, 1632 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/iteration/detail/fold.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/iteration/detail/fold.hpp new file mode 100644 index 0000000..56302fb --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/iteration/detail/fold.hpp @@ -0,0 +1,436 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + Copyright (c) 2009-2010 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_ALGORITHM_ITERATION_DETAIL_FOLD_HPP +#define BOOST_FUSION_ALGORITHM_ITERATION_DETAIL_FOLD_HPP + +#include <boost/config.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/sequence/intrinsic/end.hpp> +#include <boost/fusion/sequence/intrinsic/empty.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/fusion/iterator/equal_to.hpp> +#include <boost/fusion/iterator/deref.hpp> +#include <boost/fusion/iterator/value_of.hpp> +#include <boost/fusion/iterator/prior.hpp> +#include <boost/fusion/iterator/next.hpp> +#include <boost/preprocessor/cat.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/if.hpp> +#include <boost/mpl/bool.hpp> +#include <boost/utility/result_of.hpp> +#include <boost/type_traits/add_const.hpp> +#include <boost/type_traits/add_reference.hpp> + +#endif + +#ifdef BOOST_FUSION_REVERSE_FOLD +# ifdef BOOST_FUSION_ITER_FOLD +# define BOOST_FUSION_FOLD_NAME reverse_iter_fold +# else +# define BOOST_FUSION_FOLD_NAME reverse_fold +# endif + +# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION end +# define BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION prior +# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(IT) \ + typename fusion::result_of::prior<IT>::type +# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(IT) fusion::prior(IT) +#else +# ifdef BOOST_FUSION_ITER_FOLD +# define BOOST_FUSION_FOLD_NAME iter_fold +# else +# define BOOST_FUSION_FOLD_NAME fold +# endif + +# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION begin +# define BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION next +# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(IT) IT +# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(IT) IT +#endif +#ifdef BOOST_FUSION_ITER_FOLD +# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(IT) IT& +# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(IT) IT +#else +# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(IT) \ + typename fusion::result_of::deref<IT>::type +# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(IT) fusion::deref(IT) +#endif + +namespace boost { namespace fusion +{ + namespace detail + { + template<typename State, typename It, typename F> + struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state) + : boost::result_of< + F( + typename add_reference<typename add_const<State>::type>::type, + BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It)) + > + {}; + + template<typename Result,int N> + struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME) + { + template<typename State, typename It0, typename F> + static Result + call(State const& state,It0 const& it0,F f) + { + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It0 const + >::type + It1; + It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0); + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It1 + >::type + It2; + It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1); + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It2 + >::type + It3; + It3 it3 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it2); + + typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1; + State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)); + + typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State1,It1,F>::type State2; + State2 const state2=f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1)); + + typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State2,It2,F>::type State3; + State3 const state3=f(state2,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2)); + + return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)< + Result + , N-4 + >::call( + f(state3,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it3)), + fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it3), + f); + } + }; + + template<typename Result> + struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,3> + { + template<typename State, typename It0, typename F> + static Result + call(State const& state,It0 const& it0,F f) + { + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It0 const + >::type + It1; + It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0); + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It1 + >::type + It2; + It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1); + + typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1; + State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)); + + typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State1,It1,F>::type State2; + State2 const state2=f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1)); + + return f(state2,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2)); + } + }; + + template<typename Result> + struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,2> + { + template<typename State, typename It0, typename F> + static Result + call(State const& state,It0 const& it0,F f) + { + typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1; + State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)); + + return f( + state1, + BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM( + fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0))); + } + }; + + template<typename Result> + struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,1> + { + template<typename State, typename It0, typename F> + static Result + call(State const& state,It0 const& it0,F f) + { + return f(state, + BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)); + } + }; + + template<typename Result> + struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,0> + { + template<typename State, typename It0, typename F> + static Result + call(State const& state,It0 const& it0,F f) + { + return static_cast<Result>(state); + } + }; + + template<typename StateRef, typename It0, typename F, int N> + struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME) + { + typedef typename + BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)< + StateRef + , It0 const + , F + >::type + rest1; + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It0 const + >::type + it1; + typedef typename + BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)< + rest1 + , it1 + , F + >::type + rest2; + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<it1>::type + it2; + typedef typename + BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)< + rest2 + , it2 + , F + >::type + rest3; + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<it2>::type + it3; + + typedef typename + BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)< + typename BOOST_PP_CAT( + BOOST_FUSION_FOLD_NAME, _lvalue_state)< + rest3 + , it3 + , F + >::type + , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + it3 + >::type + , F + , N-4 + >::type + type; + }; + + template<typename StateRef, typename It0, typename F> + struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)< + StateRef + , It0 + , F + , 3 + > + { + typedef typename + BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)< + StateRef + , It0 const + , F + >::type + rest1; + typedef typename + result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It0 const + >::type + it1; + + typedef typename + BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)< + typename BOOST_PP_CAT( + BOOST_FUSION_FOLD_NAME, _lvalue_state)< + rest1 + , it1 + , F + >::type + , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + it1 const + >::type const + , F + >::type + type; + }; + + template<typename StateRef, typename It0, typename F> + struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)< + StateRef + , It0 + , F + , 2 + > + : BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)< + typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)< + StateRef + , It0 const + , F + >::type + , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It0 const + >::type const + , F + > + {}; + + template<typename StateRef, typename It0, typename F> + struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)< + StateRef + , It0 + , F + , 1 + > + : BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)< + StateRef + , It0 const + , F + > + {}; + + template<typename StateRef, typename It0, typename F> + struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)< + StateRef + , It0 + , F + , 0 + > + { + typedef StateRef type; + }; + + template<typename StateRef, typename It0, typename F, int SeqSize> + struct BOOST_PP_CAT(result_of_first_unrolled,BOOST_FUSION_FOLD_NAME) + { + typedef typename + BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)< + typename boost::result_of< + F( + StateRef, + BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM( + It0 const) + ) + >::type + , typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION< + It0 const + >::type + , F + , SeqSize-1 + >::type + type; + }; + + template<int SeqSize, typename StateRef, typename It0, typename F> + struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl) + { + typedef typename + BOOST_PP_CAT( + result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)< + StateRef + , BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(It0) + , F + , SeqSize + >::type + type; + + static type + call(StateRef state, It0 const& it0, F f) + { + return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)< + type + , SeqSize + >::call(state,BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(it0),f); + } + }; + + template<typename StateRef, typename It0, typename F> + struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<0,StateRef,It0,F> + { + typedef StateRef type; + + static StateRef + call(StateRef state, It0 const&, F) + { + return static_cast<StateRef>(state); + } + }; + } + + namespace result_of + { + template<typename Seq, typename State, typename F> + struct BOOST_FUSION_FOLD_NAME + : detail::BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)< + size<Seq>::value + , typename add_reference< + typename add_const<State>::type + >::type + , typename BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION<Seq>::type + , F + > + {}; + } + + template<typename Seq, typename State, typename F> + inline typename result_of::BOOST_FUSION_FOLD_NAME< + Seq + , State const + , F + >::type + BOOST_FUSION_FOLD_NAME(Seq& seq,State const& state,F f) + { + return result_of::BOOST_FUSION_FOLD_NAME<Seq,State const,F>::call( + state, + fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq), + f); + } + + template<typename Seq, typename State, typename F> + inline typename result_of::BOOST_FUSION_FOLD_NAME< + Seq const + , State const + , F + >::type + BOOST_FUSION_FOLD_NAME(Seq const& seq,State const& state,F f) + { + return result_of::BOOST_FUSION_FOLD_NAME<Seq const,State const,F>::call( + state, + fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq), + f); + } +}} + +#undef BOOST_FUSION_FOLD_NAME +#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION +#undef BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION +#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM +#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM +#undef BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM +#undef BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/iteration/detail/for_each.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/iteration/detail/for_each.hpp new file mode 100644 index 0000000..a23517c --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/iteration/detail/for_each.hpp @@ -0,0 +1,130 @@ +/*============================================================================= + 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_FOR_EACH_05052005_1028) +#define FUSION_FOR_EACH_05052005_1028 + +#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/next.hpp> +#include <boost/fusion/iterator/deref.hpp> +#include <boost/fusion/iterator/distance.hpp> +#include <boost/mpl/bool.hpp> + +namespace boost { namespace fusion { +namespace detail +{ + template <typename First, typename Last, typename F> + inline void + for_each_linear(First const&, Last const&, F const&, mpl::true_) + { + } + + template <typename First, typename Last, typename F> + inline void + for_each_linear(First const& first, Last const& last, F const& f, mpl::false_) + { + f(*first); + detail::for_each_linear(fusion::next(first), last, f, + result_of::equal_to<typename result_of::next<First>::type, Last>()); + } + + + template <typename Sequence, typename F, typename Tag> + inline void + for_each(Sequence& seq, F const& f, Tag) + { + detail::for_each_linear( + fusion::begin(seq) + , fusion::end(seq) + , f + , result_of::equal_to< + typename result_of::begin<Sequence>::type + , typename result_of::end<Sequence>::type>()); + } + + template<int N> + struct for_each_unrolled + { + template<typename I0, typename F> + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next<I0>::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + typedef typename result_of::next<I1>::type I2; + I2 i2(fusion::next(i1)); + f(*i2); + typedef typename result_of::next<I2>::type I3; + I3 i3(fusion::next(i2)); + f(*i3); + for_each_unrolled<N-4>::call(fusion::next(i3), f); + } + }; + + template<> + struct for_each_unrolled<3> + { + template<typename I0, typename F> + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next<I0>::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + typedef typename result_of::next<I1>::type I2; + I2 i2(fusion::next(i1)); + f(*i2); + } + }; + + template<> + struct for_each_unrolled<2> + { + template<typename I0, typename F> + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next<I0>::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + } + }; + + template<> + struct for_each_unrolled<1> + { + template<typename I0, typename F> + static void call(I0 const& i0, F const& f) + { + f(*i0); + } + }; + + template<> + struct for_each_unrolled<0> + { + template<typename It, typename F> + static void call(It const&, F const&) + { + } + }; + + template <typename Sequence, typename F> + inline void + for_each(Sequence& seq, F const& f, random_access_traversal_tag) + { + typedef typename result_of::begin<Sequence>::type begin; + typedef typename result_of::end<Sequence>::type end; + for_each_unrolled<result_of::distance<begin, end>::type::value>::call(fusion::begin(seq), f); + } +}}} + + +#endif + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/iteration/fold.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/iteration/fold.hpp new file mode 100644 index 0000000..347fb4f --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/iteration/fold.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2007 Dan Marsden + Copyright (c) 2009-2010 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_ALGORITHM_ITERATION_FOLD_HPP +#define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP + +#include <boost/fusion/algorithm/iteration/detail/fold.hpp> + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/iteration/for_each.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/iteration/for_each.hpp new file mode 100644 index 0000000..fffb0f0 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/iteration/for_each.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2007 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(BOOST_FUSION_FOR_EACH_20070527_0943) +#define BOOST_FUSION_FOR_EACH_20070527_0943 + +#include <boost/fusion/algorithm/iteration/detail/for_each.hpp> + +#include <boost/fusion/support/category_of.hpp> + +namespace boost { namespace fusion { + + namespace result_of + { + template <typename Sequence, typename F> + struct for_each + { + typedef void type; + }; + } + + struct random_access_traversal_tag; + + template <typename Sequence, typename F> + inline void + for_each(Sequence& seq, F const& f) + { + detail::for_each(seq, f, typename traits::category_of<Sequence>::type()); + } + + template <typename Sequence, typename F> + inline void + for_each(Sequence const& seq, F const& f) + { + detail::for_each(seq, f, typename traits::category_of<Sequence>::type()); + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/query/any.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/query/any.hpp new file mode 100644 index 0000000..be4ef09 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/query/any.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005 Eric Niebler + Copyright (c) 2007 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_ANY_05052005_1230) +#define FUSION_ANY_05052005_1230 + +#include <boost/fusion/support/category_of.hpp> +#include <boost/fusion/algorithm/query/detail/any.hpp> + +namespace boost { namespace fusion +{ + namespace result_of + { + template <typename Sequence, typename F> + struct any + { + typedef bool type; + }; + } + + template <typename Sequence, typename F> + inline bool + any(Sequence const& seq, F f) + { + return detail::any(seq, f, typename traits::category_of<Sequence>::type()); + } +}} + +#endif + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/query/detail/any.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/query/detail/any.hpp new file mode 100644 index 0000000..31bbaa5 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/query/detail/any.hpp @@ -0,0 +1,130 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005 Eric Niebler + Copyright (c) 2007 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_ANY_05052005_1229) +#define FUSION_ANY_05052005_1229 + +#include <boost/mpl/bool.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/sequence/intrinsic/end.hpp> +#include <boost/fusion/iterator/advance.hpp> +#include <boost/fusion/iterator/equal_to.hpp> +#include <boost/fusion/iterator/next.hpp> +#include <boost/fusion/iterator/deref.hpp> +#include <boost/fusion/iterator/distance.hpp> + +namespace boost { namespace fusion { + struct random_access_traversal_tag; +namespace detail +{ + template <typename First, typename Last, typename F> + inline bool + linear_any(First const&, Last const&, F const&, mpl::true_) + { + return false; + } + + template <typename First, typename Last, typename F> + inline bool + linear_any(First const& first, Last const& last, F& f, mpl::false_) + { + typename result_of::deref<First>::type x = *first; + return f(x) || + detail::linear_any( + fusion::next(first) + , last + , f + , result_of::equal_to<typename result_of::next<First>::type, Last>()); + } + + template <typename Sequence, typename F, typename Tag> + inline bool + any(Sequence const& seq, F f, Tag) + { + return detail::linear_any( + fusion::begin(seq) + , fusion::end(seq) + , f + , result_of::equal_to< + typename result_of::begin<Sequence>::type + , typename result_of::end<Sequence>::type>()); + } + + template<int N> + struct unrolled_any + { + template <typename It, typename F> + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it))|| + f(*fusion::advance_c<2>(it)) || + f(*fusion::advance_c<3>(it)) || + detail::unrolled_any<N-4>::call(fusion::advance_c<4>(it), f); + } + }; + + template<> + struct unrolled_any<3> + { + template <typename It, typename F> + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it)) || + f(*fusion::advance_c<2>(it)); + } + }; + + template<> + struct unrolled_any<2> + { + template <typename It, typename F> + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it)); + } + }; + + template<> + struct unrolled_any<1> + { + template <typename It, typename F> + static bool call(It const& it, F f) + { + return f(*it); + } + }; + + template<> + struct unrolled_any<0> + { + template <typename It, typename F> + static bool call(It const& it, F f) + { + return false; + } + }; + + template <typename Sequence, typename F> + inline bool + any(Sequence const& seq, F f, random_access_traversal_tag) + { + typedef typename result_of::begin<Sequence>::type begin; + typedef typename result_of::end<Sequence>::type end; + return detail::unrolled_any<result_of::distance<begin, end>::type::value>::call( + fusion::begin(seq), f); + } +}}} + +#endif + diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/query/detail/find_if.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/query/detail/find_if.hpp new file mode 100644 index 0000000..5d2a741 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/query/detail/find_if.hpp @@ -0,0 +1,232 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Dan Marsden + 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) +==============================================================================*/ +#if !defined(FUSION_FIND_IF_05052005_1107) +#define FUSION_FIND_IF_05052005_1107 + +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/or.hpp> +#include <boost/mpl/lambda.hpp> +#include <boost/mpl/apply.hpp> +#include <boost/mpl/identity.hpp> +#include <boost/fusion/iterator/equal_to.hpp> +#include <boost/fusion/iterator/next.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/iterator/advance.hpp> +#include <boost/fusion/iterator/distance.hpp> +#include <boost/fusion/support/category_of.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/identity.hpp> + +namespace boost { namespace fusion { + struct random_access_traversal_tag; +namespace detail +{ + template <typename Iterator, typename Pred> + struct apply_filter + { + typedef typename mpl::apply1< + Pred, Iterator>::type type; + BOOST_STATIC_CONSTANT(int, value = type::value); + }; + + template <typename First, typename Last, typename Pred> + struct main_find_if; + + template <typename First, typename Last, typename Pred> + struct recursive_find_if + { + typedef typename + main_find_if< + typename result_of::next<First>::type, Last, Pred + >::type + type; + }; + + template <typename First, typename Last, typename Pred> + struct main_find_if + { + typedef mpl::or_< + result_of::equal_to<First, Last> + , apply_filter<First, Pred> > + filter; + + typedef typename + mpl::eval_if< + filter + , mpl::identity<First> + , recursive_find_if<First, Last, Pred> + >::type + type; + }; + + template< + typename First, typename Last, + typename Pred, bool> + struct choose_find_if; + + template<typename First, typename Last, typename Pred> + struct choose_find_if<First, Last, Pred, false> + : main_find_if<First, Last, Pred> + {}; + + template<typename Iter, typename Pred, int n, int unrolling> + struct unroll_again; + + template <typename Iter, typename Pred, int offset> + struct apply_offset_filter + { + typedef typename result_of::advance_c<Iter, offset>::type Shifted; + typedef typename + mpl::apply1< + Pred + , Shifted + >::type + type; + BOOST_STATIC_CONSTANT(int, value = type::value); + }; + + template<typename Iter, typename Pred, int n> + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter<Iter, Pred>, + mpl::identity<Iter>, + mpl::eval_if< + apply_offset_filter<Iter, Pred, 1>, + result_of::advance_c<Iter, 1>, + mpl::eval_if< + apply_offset_filter<Iter, Pred, 2>, + result_of::advance_c<Iter, 2>, + mpl::eval_if< + apply_offset_filter<Iter, Pred, 3>, + result_of::advance_c<Iter, 3>, + unroll_again< + Iter, + Pred, + n, + 4> > > > >::type type; + }; + + template<typename Iter, typename Pred> + struct unrolled_find_if<Iter, Pred, 3> + { + typedef typename mpl::eval_if< + apply_filter<Iter, Pred>, + mpl::identity<Iter>, + mpl::eval_if< + apply_offset_filter<Iter, Pred, 1>, + result_of::advance_c<Iter, 1>, + mpl::eval_if< + apply_offset_filter<Iter, Pred, 2>, + result_of::advance_c<Iter, 2>, + result_of::advance_c<Iter, 3> > > >::type type; + }; + + template<typename Iter, typename Pred> + struct unrolled_find_if<Iter, Pred, 2> + { + typedef typename mpl::eval_if< + apply_filter<Iter, Pred>, + mpl::identity<Iter>, + mpl::eval_if< + apply_offset_filter<Iter, Pred, 1>, + result_of::advance_c<Iter, 1>, + result_of::advance_c<Iter, 2> > >::type type; + }; + + template<typename Iter, typename Pred> + struct unrolled_find_if<Iter, Pred, 1> + { + typedef typename mpl::eval_if< + apply_filter<Iter, Pred>, + mpl::identity<Iter>, + result_of::advance_c<Iter, 1> >::type type; + }; + + template<typename Iter, typename Pred, int n, int unrolling> + struct unroll_again + { + typedef typename unrolled_find_if< + typename result_of::advance_c<Iter, unrolling>::type, + Pred, + n-unrolling>::type type; + }; + + template<typename Iter, typename Pred> + struct unrolled_find_if<Iter, Pred, 0> + { + typedef Iter type; + }; + + template<typename First, typename Last, typename Pred> + struct choose_find_if<First, Last, Pred, true> + { + typedef typename result_of::distance<First, Last>::type N; + typedef typename unrolled_find_if<First, Pred, N::value>::type type; + }; + + template <typename First, typename Last, typename Pred> + struct static_find_if + { + typedef typename + choose_find_if< + First + , Last + , typename mpl::lambda<Pred>::type + , is_base_of<random_access_traversal_tag, typename traits::category_of<First>::type>::value + >::type + type; + + template <typename Iterator> + static type + recursive_call(Iterator const& iter, mpl::true_) + { + return iter; + } + + template <typename Iterator> + static type + recursive_call(Iterator const& iter, mpl::false_) + { + return recursive_call(fusion::next(iter)); + } + + template <typename Iterator> + static type + recursive_call(Iterator const& iter) + { + typedef result_of::equal_to<Iterator, type> found; + return recursive_call(iter, found()); + } + + template <typename Iterator, typename Tag> + static type + choose_call(Iterator const& iter, Tag) + { + return recursive_call(iter); + } + + template <typename Iterator> + static type + choose_call(Iterator const& iter, random_access_traversal_tag) + { + typedef typename result_of::distance<Iterator, type>::type N; + return fusion::advance<N>(iter); + } + + template <typename Iterator> + static type + call(Iterator const& iter) + { + return choose_call(iter, typename traits::category_of<Iterator>::type()); + } + }; +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/algorithm/query/find.hpp b/3rdParty/Boost/src/boost/fusion/algorithm/query/find.hpp new file mode 100644 index 0000000..6beb900 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/algorithm/query/find.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + 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_FIND_05052005_1107) +#define FUSION_FIND_05052005_1107 + +#include <boost/fusion/algorithm/query/detail/find_if.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/sequence/intrinsic/end.hpp> +#include <boost/fusion/iterator/key_of.hpp> +#include <boost/fusion/iterator/value_of.hpp> +#include <boost/fusion/support/category_of.hpp> +#include <boost/mpl/if.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/type_traits/is_const.hpp> +#include <boost/utility/enable_if.hpp> + +namespace boost { namespace fusion +{ + namespace result_of + { + template < + typename Sequence + , typename T + > + struct find + { + typedef + detail::static_find_if< + typename result_of::begin<Sequence>::type + , typename result_of::end<Sequence>::type + , is_same< + typename mpl::if_< + traits::is_associative<Sequence> + , key_of<mpl::_1> + , value_of<mpl::_1> + >::type + , T + > + > + filter; + + typedef typename filter::type type; + }; + } + + template <typename T, typename Sequence> + inline typename + lazy_disable_if< + is_const<Sequence> + , result_of::find<Sequence, T> + >::type const + find(Sequence& seq) + { + typedef typename result_of::find<Sequence, T>::filter filter; + return filter::call(fusion::begin(seq)); + } + + template <typename T, typename Sequence> + inline typename result_of::find<Sequence const, T>::type const + find(Sequence const& seq) + { + typedef typename result_of::find<Sequence const, T>::filter filter; + return filter::call(fusion::begin(seq)); + } +}} + +#endif + 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 + |