diff options
author | Kevin Smith <git@kismith.co.uk> | 2013-01-12 18:41:34 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-01-13 10:36:26 (GMT) |
commit | f3bc816af1b0d61452de973963e453bf3b3f95a2 (patch) | |
tree | e895f8afa3580e6cff6f5ad2017d45bf147a17c2 /3rdParty/Boost/src/boost/fusion/support | |
parent | 188fc285c6555eadd3c9d50ab8a94adcade78d89 (diff) | |
download | swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.zip swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.tar.bz2 |
Adding in the spirit Boost stuff
Change-Id: I4f127ce61667243b64081b0aa309028d5077045f
Diffstat (limited to '3rdParty/Boost/src/boost/fusion/support')
20 files changed, 1331 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/fusion/support/as_const.hpp b/3rdParty/Boost/src/boost/fusion/support/as_const.hpp new file mode 100644 index 0000000..bb2a96a --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/as_const.hpp @@ -0,0 +1,26 @@ +/*============================================================================= + Copyright (c) 2012 Nathan Ridge + + 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_SUPPORT_AS_CONST_HPP +#define BOOST_FUSION_SUPPORT_AS_CONST_HPP + +namespace boost { namespace fusion { namespace extension +{ + // A customization point that allows certain wrappers around + // Fusion sequence elements (e.g. adt_attribute_proxy) to be + // unwrapped in contexts where the element only needs to be + // read. The library wraps accesses to Fusion elements in + // such contexts with calls to this function. Users can + // specialize this function for their own wrappers. + template <typename T> + const T& as_const(const T& obj) + { + return obj; + } + +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/category_of.hpp b/3rdParty/Boost/src/boost/fusion/support/category_of.hpp new file mode 100644 index 0000000..805d895 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/category_of.hpp @@ -0,0 +1,112 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_CATEGORY_OF_07202005_0308) +#define FUSION_CATEGORY_OF_07202005_0308 + +#include <boost/fusion/support/detail/category_of.hpp> +#include <boost/fusion/support/tag_of.hpp> +#include <boost/type_traits/is_base_of.hpp> + +namespace boost { namespace fusion +{ + // Special tags: + struct boost_tuple_tag; // boost::tuples::tuple tag + struct boost_array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + struct incrementable_traversal_tag {}; + + struct single_pass_traversal_tag + : incrementable_traversal_tag {}; + + struct forward_traversal_tag + : single_pass_traversal_tag {}; + + struct bidirectional_traversal_tag + : forward_traversal_tag {}; + + struct random_access_traversal_tag + : bidirectional_traversal_tag {}; + + struct associative_tag {}; + + namespace extension + { + template<typename Tag> + struct category_of_impl + { + template<typename T> + struct apply : detail::fusion_category_of<T> {}; + }; + + template <> + struct category_of_impl<boost_tuple_tag>; + + template <> + struct category_of_impl<boost_array_tag>; + + template <> + struct category_of_impl<mpl_sequence_tag>; + + template <> + struct category_of_impl<std_pair_tag>; + } + + namespace traits + { + template <typename T> + struct category_of + : extension::category_of_impl<typename fusion::detail::tag_of<T>::type>:: + template apply<T> + {}; + + template <typename T> + struct is_associative + : is_base_of< + associative_tag + , typename category_of<T>::type> + {}; + + template <typename T> + struct is_incrementable + : is_base_of< + incrementable_traversal_tag + , typename category_of<T>::type> + {}; + + template <typename T> + struct is_single_pass + : is_base_of< + single_pass_traversal_tag + , typename category_of<T>::type> + {}; + + template <typename T> + struct is_forward + : is_base_of< + forward_traversal_tag + , typename category_of<T>::type> + {}; + + template <typename T> + struct is_bidirectional + : is_base_of< + bidirectional_traversal_tag + , typename category_of<T>::type> + {}; + + template <typename T> + struct is_random_access + : is_base_of< + random_access_traversal_tag + , typename category_of<T>::type> + {}; + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/detail/access.hpp b/3rdParty/Boost/src/boost/fusion/support/detail/access.hpp new file mode 100644 index 0000000..ced7cea --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/detail/access.hpp @@ -0,0 +1,64 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_ACCESS_04182005_0737) +#define FUSION_ACCESS_04182005_0737 + +#include <boost/type_traits/add_const.hpp> +#include <boost/type_traits/add_reference.hpp> + +namespace boost { namespace fusion { namespace detail +{ + template <typename T> + struct ref_result + { + typedef typename add_reference<T>::type type; + }; + + template <typename T> + struct cref_result + { + typedef typename + add_reference< + typename add_const<T>::type + >::type + type; + }; + + template <typename T> + struct call_param + { + typedef T const& type; + }; + + template <typename T> + struct call_param<T &> + { + typedef T& type; + }; + + template <typename T> + struct call_param<T const> + { + typedef T const& type; + }; + + template <typename T> + struct call_param<T volatile> + { + typedef T const& type; + }; + + template <typename T> + struct call_param<T const volatile> + { + typedef T const& type; + }; + +}}} + +#endif + diff --git a/3rdParty/Boost/src/boost/fusion/support/detail/as_fusion_element.hpp b/3rdParty/Boost/src/boost/fusion/support/detail/as_fusion_element.hpp new file mode 100644 index 0000000..96cf2d0 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/detail/as_fusion_element.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Jarvi + Copyright (c) 2001-2011 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_AS_FUSION_ELEMENT_05052005_0338) +#define FUSION_AS_FUSION_ELEMENT_05052005_0338 + +#include <boost/ref.hpp> + +namespace boost { namespace fusion { namespace detail +{ + template <typename T> + struct as_fusion_element + { + typedef T type; + }; + + template <typename T> + struct as_fusion_element<reference_wrapper<T> > + { + typedef T& type; + }; + + template <typename T, int N> + struct as_fusion_element<T[N]> + { + typedef const T(&type)[N]; + }; + + template <typename T, int N> + struct as_fusion_element<volatile T[N]> + { + typedef const volatile T(&type)[N]; + }; + + template <typename T, int N> + struct as_fusion_element<const volatile T[N]> + { + typedef const volatile T(&type)[N]; + }; + +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/detail/category_of.hpp b/3rdParty/Boost/src/boost/fusion/support/detail/category_of.hpp new file mode 100644 index 0000000..e7ac44e --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/detail/category_of.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_CATEGORY_OF_07212005_1025) +#define FUSION_CATEGORY_OF_07212005_1025 + +namespace boost { namespace fusion { namespace detail +{ + template <typename T> + struct fusion_category_of + { + typedef typename T::category type; + }; +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/detail/is_mpl_sequence.hpp b/3rdParty/Boost/src/boost/fusion/support/detail/is_mpl_sequence.hpp new file mode 100644 index 0000000..376afc2 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/detail/is_mpl_sequence.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_DETAIL_IS_MPL_SEQUENCE_29122006_1105) +#define FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105 + +#include <boost/fusion/support/sequence_base.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/mpl/and.hpp> +#include <boost/mpl/not.hpp> +#include <boost/type_traits/is_convertible.hpp> + +namespace boost { namespace fusion { namespace detail +{ + template <typename T> + struct is_mpl_sequence + : mpl::and_< + mpl::not_<is_convertible<T, from_sequence_convertible_type> > + , mpl::is_sequence<T> > + {}; +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/detail/is_view.hpp b/3rdParty/Boost/src/boost/fusion/support/detail/is_view.hpp new file mode 100644 index 0000000..c518dfc --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/detail/is_view.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_IS_VIEW_03202006_0018) +#define FUSION_IS_VIEW_03202006_0018 + +namespace boost { namespace fusion { namespace detail +{ + template <typename T> + struct fusion_is_view + { + typedef typename T::is_view type; + }; +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/detail/mpl_iterator_category.hpp b/3rdParty/Boost/src/boost/fusion/support/detail/mpl_iterator_category.hpp new file mode 100644 index 0000000..fcb00a0 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/detail/mpl_iterator_category.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_MPL_ITERATOR_CATEGORY_07212005_0923) +#define FUSION_MPL_ITERATOR_CATEGORY_07212005_0923 + +namespace boost { namespace mpl +{ + struct forward_iterator_tag; + struct bidirectional_iterator_tag; + struct random_access_iterator_tag; +}} + +namespace boost { namespace fusion +{ + struct forward_traversal_tag; + struct bidirectional_traversal_tag; + struct random_access_traversal_tag; +}} + +namespace boost { namespace fusion { namespace detail +{ + template <typename Category> + struct mpl_iterator_category; + + template <> + struct mpl_iterator_category<mpl::forward_iterator_tag> + { + typedef forward_traversal_tag type; + }; + + template <> + struct mpl_iterator_category<mpl::bidirectional_iterator_tag> + { + typedef bidirectional_traversal_tag type; + }; + + template <> + struct mpl_iterator_category<mpl::random_access_iterator_tag> + { + typedef random_access_traversal_tag type; + }; + + template <> + struct mpl_iterator_category<forward_traversal_tag> + { + typedef forward_traversal_tag type; + }; + + template <> + struct mpl_iterator_category<bidirectional_traversal_tag> + { + typedef bidirectional_traversal_tag type; + }; + + template <> + struct mpl_iterator_category<random_access_traversal_tag> + { + typedef random_access_traversal_tag type; + }; +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/detail/pp_round.hpp b/3rdParty/Boost/src/boost/fusion/support/detail/pp_round.hpp new file mode 100644 index 0000000..e1a6161 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/detail/pp_round.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2011 Thomas Heller + + 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_BOOST_FUSION_SUPPORT_PP_ROUND_HPP +#define BOOST_BOOST_FUSION_SUPPORT_PP_ROUND_HPP + +#include <boost/preprocessor/cat.hpp> +#include <boost/preprocessor/comparison/less.hpp> +#include <boost/preprocessor/control/if.hpp> + +#define BOOST_FUSION_PP_ROUND_UP(N) \ + BOOST_PP_CAT(BOOST_FUSION_PP_DO_ROUND_UP_, N)() \ +/**/ + +#define BOOST_FUSION_PP_DO_ROUND_UP_0() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_1() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_2() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_3() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_4() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_5() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_6() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_7() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_8() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_9() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_10() 10 +#define BOOST_FUSION_PP_DO_ROUND_UP_11() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_12() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_13() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_14() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_15() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_16() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_17() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_18() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_19() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_20() 20 +#define BOOST_FUSION_PP_DO_ROUND_UP_21() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_22() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_23() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_24() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_25() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_26() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_27() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_28() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_29() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_30() 30 +#define BOOST_FUSION_PP_DO_ROUND_UP_31() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_32() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_33() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_34() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_35() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_36() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_37() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_38() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_39() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_40() 40 +#define BOOST_FUSION_PP_DO_ROUND_UP_41() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_42() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_43() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_44() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_45() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_46() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_47() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_48() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_49() 50 +#define BOOST_FUSION_PP_DO_ROUND_UP_50() 50 + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/detail/segmented_fold_until_impl.hpp b/3rdParty/Boost/src/boost/fusion/support/detail/segmented_fold_until_impl.hpp new file mode 100644 index 0000000..08096c1 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/detail/segmented_fold_until_impl.hpp @@ -0,0 +1,389 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_SEGMENTED_FOLD_UNTIL_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_SEGMENTED_FOLD_UNTIL_IMPL_HPP_INCLUDED + +#include <boost/mpl/bool.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/identity.hpp> +#include <boost/utility/result_of.hpp> +#include <boost/type_traits/add_const.hpp> +#include <boost/type_traits/remove_reference.hpp> + +#include <boost/fusion/support/void.hpp> +#include <boost/fusion/container/list/cons_fwd.hpp> +#include <boost/fusion/sequence/intrinsic_fwd.hpp> +#include <boost/fusion/iterator/equal_to.hpp> +#include <boost/fusion/iterator/deref.hpp> +#include <boost/fusion/iterator/next.hpp> +#include <boost/fusion/support/is_segmented.hpp> +#include <boost/fusion/sequence/intrinsic/segments.hpp> + +// fun(seq, state, context) +// seq: a non-segmented range +// state: the state of the fold so far +// context: the path to the current range +// +// returns: (state', fcontinue) + +namespace boost { namespace fusion +{ + template <typename First, typename Last> + struct iterator_range; + + template <typename Context> + struct segmented_iterator; + + namespace result_of + { + template <typename Cur, typename Context> + struct make_segmented_iterator + { + typedef + iterator_range< + Cur + , typename result_of::end< + typename remove_reference< + typename add_const< + typename result_of::deref< + typename Context::car_type::begin_type + >::type + >::type + >::type + >::type + > + range_type; + + typedef + segmented_iterator<cons<range_type, Context> > + type; + }; + } + + template <typename Cur, typename Context> + typename result_of::make_segmented_iterator<Cur, Context>::type + make_segmented_iterator(Cur const& cur, Context const& context) + { + typedef result_of::make_segmented_iterator<Cur, Context> impl_type; + typedef typename impl_type::type type; + typedef typename impl_type::range_type range_type; + return type(cons<range_type, Context>(range_type(cur, fusion::end(*context.car.first)), context)); + } + + namespace detail + { + template < + typename Begin + , typename End + , typename State + , typename Context + , typename Fun + , bool IsEmpty + > + struct segmented_fold_until_iterate_skip_empty; + + template < + typename Begin + , typename End + , typename State + , typename Context + , typename Fun + , bool IsDone = result_of::equal_to<Begin, End>::type::value + > + struct segmented_fold_until_iterate; + + template < + typename Sequence + , typename State + , typename Context + , typename Fun + , bool IsSegmented = traits::is_segmented<Sequence>::type::value + > + struct segmented_fold_until_impl; + + template <typename Segments, typename State, typename Context, typename Fun> + struct segmented_fold_until_on_segments; + + //auto push_context(cur, end, context) + //{ + // return push_back(context, segment_sequence(iterator_range(cur, end))); + //} + + template <typename Cur, typename End, typename Context> + struct push_context + { + typedef iterator_range<Cur, End> range_type; + typedef cons<range_type, Context> type; + + static type call(Cur const& cur, End const& end, Context const& context) + { + return cons<range_type, Context>(range_type(cur, end), context); + } + }; + + //auto make_segmented_iterator(cur, end, context) + //{ + // return segmented_iterator(push_context(cur, end, context)); + //} + // + //auto segmented_fold_until_impl(seq, state, context, fun) + //{ + // if (is_segmented(seq)) + // { + // segmented_fold_until_on_segments(segments(seq), state, context, fun); + // } + // else + // { + // return fun(seq, state, context); + // } + //} + + template < + typename Sequence + , typename State + , typename Context + , typename Fun + , bool IsSegmented + > + struct segmented_fold_until_impl + { + typedef + segmented_fold_until_on_segments< + typename remove_reference< + typename add_const< + typename result_of::segments<Sequence>::type + >::type + >::type + , State + , Context + , Fun + > + impl; + + typedef typename impl::type type; + typedef typename impl::continue_type continue_type; + + static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun) + { + return impl::call(fusion::segments(seq), state, context, fun); + } + }; + + template < + typename Sequence + , typename State + , typename Context + , typename Fun + > + struct segmented_fold_until_impl<Sequence, State, Context, Fun, false> + { + typedef + typename Fun::template apply<Sequence, State, Context> + apply_type; + + typedef typename apply_type::type type; + typedef typename apply_type::continue_type continue_type; + + static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun) + { + return apply_type::call(seq, state, context, fun); + } + }; + + //auto segmented_fold_until_on_segments(segs, state, context, fun) + //{ + // auto cur = begin(segs), end = end(segs); + // for (; cur != end; ++cur) + // { + // if (empty(*cur)) + // continue; + // auto context` = push_context(cur, end, context); + // state = segmented_fold_until_impl(*cur, state, context`, fun); + // if (!second(state)) + // return state; + // } + //} + + template <typename Apply> + struct continue_wrap + { + typedef typename Apply::continue_type type; + }; + + template <typename Begin, typename End, typename State, typename Context, typename Fun, bool IsEmpty> + struct segmented_fold_until_iterate_skip_empty + { + // begin != end and !empty(*begin) + typedef + push_context<Begin, End, Context> + push_context_impl; + + typedef + typename push_context_impl::type + next_context_type; + + typedef + segmented_fold_until_impl< + typename remove_reference< + typename add_const< + typename result_of::deref<Begin>::type + >::type + >::type + , State + , next_context_type + , Fun + > + fold_recurse_impl; + + typedef + typename fold_recurse_impl::type + next_state_type; + + typedef + segmented_fold_until_iterate< + typename result_of::next<Begin>::type + , End + , next_state_type + , Context + , Fun + > + next_iteration_impl; + + typedef + typename mpl::eval_if< + typename fold_recurse_impl::continue_type + , next_iteration_impl + , mpl::identity<next_state_type> + >::type + type; + + typedef + typename mpl::eval_if< + typename fold_recurse_impl::continue_type + , continue_wrap<next_iteration_impl> + , mpl::identity<mpl::false_> + >::type + continue_type; + + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun) + { + return call(beg, end, state, context, fun, typename fold_recurse_impl::continue_type()); + } + + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun, mpl::true_) // continue + { + return next_iteration_impl::call( + fusion::next(beg) + , end + , fold_recurse_impl::call( + *beg + , state + , push_context_impl::call(beg, end, context) + , fun) + , context + , fun); + } + + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun, mpl::false_) // break + { + return fold_recurse_impl::call( + *beg + , state + , push_context_impl::call(beg, end, context) + , fun); + } + }; + + template <typename Begin, typename End, typename State, typename Context, typename Fun> + struct segmented_fold_until_iterate_skip_empty<Begin, End, State, Context, Fun, true> + { + typedef + segmented_fold_until_iterate< + typename result_of::next<Begin>::type + , End + , State + , Context + , Fun + > + impl; + + typedef typename impl::type type; + typedef typename impl::continue_type continue_type; + + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun) + { + return impl::call(fusion::next(beg), end, state, context, fun); + } + }; + + template <typename Begin, typename End, typename State, typename Context, typename Fun, bool IsDone> + struct segmented_fold_until_iterate + { + typedef + typename result_of::empty< + typename remove_reference< + typename result_of::deref<Begin>::type + >::type + >::type + empty_type; + + typedef + segmented_fold_until_iterate_skip_empty<Begin, End, State, Context, Fun, empty_type::value> + impl; + + typedef typename impl::type type; + typedef typename impl::continue_type continue_type; + + static type call(Begin const& beg, End const& end, State const& state + , Context const& context, Fun const& fun) + { + return impl::call(beg, end, state, context, fun); + } + }; + + template <typename Begin, typename End, typename State, typename Context, typename Fun> + struct segmented_fold_until_iterate<Begin, End, State, Context, Fun, true> + { + typedef State type; + typedef mpl::true_ continue_type; + + static type call(Begin const&, End const&, State const& state + , Context const&, Fun const&) + { + return state; + } + }; + + template <typename Segments, typename State, typename Context, typename Fun> + struct segmented_fold_until_on_segments + { + typedef + segmented_fold_until_iterate< + typename result_of::begin<Segments>::type + , typename result_of::end<Segments>::type + , State + , Context + , Fun + > + impl; + + typedef typename impl::type type; + typedef typename impl::continue_type continue_type; + + static type call(Segments& segs, State const& state, Context const& context, Fun const& fun) + { + return impl::call(fusion::begin(segs), fusion::end(segs), state, context, fun); + } + }; + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/is_iterator.hpp b/3rdParty/Boost/src/boost/fusion/support/is_iterator.hpp new file mode 100644 index 0000000..f0272d0 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/is_iterator.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_IS_ITERATOR_05062005_1219) +#define FUSION_IS_ITERATOR_05062005_1219 + +#include <boost/type_traits/is_base_of.hpp> + +namespace boost { namespace fusion +{ + struct iterator_root; + + template <typename T> + struct is_fusion_iterator : is_base_of<iterator_root, T> {}; +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/is_segmented.hpp b/3rdParty/Boost/src/boost/fusion/support/is_segmented.hpp new file mode 100644 index 0000000..6e62eac --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/is_segmented.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + 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_IS_SEGMENTED_03202006_0015) +#define FUSION_IS_SEGMENTED_03202006_0015 + +#include <boost/mpl/bool.hpp> +#include <boost/fusion/support/tag_of.hpp> + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct iterator_range_tag; + + namespace extension + { + template <typename Tag> + struct is_segmented_impl + { + template <typename Sequence> + struct apply + : mpl::false_ + {}; + }; + + template <> + struct is_segmented_impl<sequence_facade_tag> + { + template <typename Sequence> + struct apply : Sequence::is_segmented {}; + }; + + template <> + struct is_segmented_impl<iterator_range_tag>; + } + + namespace traits + { + template <typename Sequence> + struct is_segmented + : mpl::bool_< + (bool)extension::is_segmented_impl<typename traits::tag_of<Sequence>::type>:: + template apply<Sequence>::type::value + > + { + }; + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/is_sequence.hpp b/3rdParty/Boost/src/boost/fusion/support/is_sequence.hpp new file mode 100644 index 0000000..184bbbb --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/is_sequence.hpp @@ -0,0 +1,76 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_IS_SEQUENCE_05052005_1002) +#define FUSION_IS_SEQUENCE_05052005_1002 + +#include <boost/fusion/support/sequence_base.hpp> +#include <boost/fusion/support/tag_of.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/mpl/or.hpp> +#include <boost/mpl/bool.hpp> +#include <boost/type_traits/is_convertible.hpp> +#include <boost/type_traits/is_same.hpp> + +namespace boost { namespace fusion +{ + // Special tags: + struct non_fusion_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct boost_array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template <typename T> + struct is_sequence_impl + { + template <typename Sequence> + struct apply + : is_convertible<Sequence, detail::from_sequence_convertible_type> + {}; + }; + + template <> + struct is_sequence_impl<non_fusion_tag> + { + template <typename T> + struct apply : mpl::false_ {}; + }; + + template <> + struct is_sequence_impl<boost_tuple_tag>; + + template <> + struct is_sequence_impl<boost_array_tag>; + + template <> + struct is_sequence_impl<mpl_sequence_tag>; + + template <> + struct is_sequence_impl<std_pair_tag>; + } + + namespace traits + { + template <typename T> + struct is_sequence + : mpl::bool_< + (bool)extension::is_sequence_impl< + typename fusion::detail::tag_of<T>::type + >::template apply<T>::type::value + > + {}; + + template <typename Sequence, typename Enable = void> + struct is_native_fusion_sequence + : is_convertible<Sequence, detail::from_sequence_convertible_type> + {}; + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/is_view.hpp b/3rdParty/Boost/src/boost/fusion/support/is_view.hpp new file mode 100644 index 0000000..4ec9e06 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/is_view.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_IS_VIEW_03202006_0015) +#define FUSION_IS_VIEW_03202006_0015 + +#include <boost/mpl/bool.hpp> +#include <boost/fusion/support/detail/is_view.hpp> +#include <boost/fusion/support/tag_of.hpp> + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct boost_array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template<typename Tag> + struct is_view_impl + { + template <typename T> + struct apply + : detail::fusion_is_view<T> + {}; + }; + + template <> + struct is_view_impl<sequence_facade_tag> + { + template <typename Sequence> + struct apply : Sequence::is_view {}; + }; + + template <> + struct is_view_impl<boost_tuple_tag>; + + template <> + struct is_view_impl<boost_array_tag>; + + template <> + struct is_view_impl<mpl_sequence_tag>; + + template <> + struct is_view_impl<std_pair_tag>; + } + + namespace traits + { + template <typename T> + struct is_view : + mpl::bool_< + (bool)extension::is_view_impl<typename fusion::detail::tag_of<T>::type>:: + template apply<T>::type::value + > + {}; + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/iterator_base.hpp b/3rdParty/Boost/src/boost/fusion/support/iterator_base.hpp new file mode 100644 index 0000000..ad24d93 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/iterator_base.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_ITERATOR_BASE_05042005_1008) +#define FUSION_ITERATOR_BASE_05042005_1008 + +namespace boost { namespace fusion +{ + struct iterator_root {}; + + template <typename Iterator> + struct iterator_base : iterator_root + { + Iterator const& + cast() const + { + return static_cast<Iterator const&>(*this); + } + + Iterator& + cast() + { + return static_cast<Iterator&>(*this); + } + }; +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/segmented_fold_until.hpp b/3rdParty/Boost/src/boost/fusion/support/segmented_fold_until.hpp new file mode 100644 index 0000000..6ea58ac --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/segmented_fold_until.hpp @@ -0,0 +1,73 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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_SEGMENTED_FOLD_UNTIL_HPP_INCLUDED) +#define BOOST_FUSION_SEGMENTED_FOLD_UNTIL_HPP_INCLUDED + +#include <boost/type_traits/is_const.hpp> +#include <boost/utility/enable_if.hpp> +#include <boost/fusion/support/detail/segmented_fold_until_impl.hpp> +#include <boost/fusion/view/iterator_range.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/container/list/cons.hpp> + +namespace boost { namespace fusion +{ + //auto segmented_fold_until(seq, state, fun) + //{ + // return first(segmented_fold_until_impl(seq, state, nil, fun)); + //} + + namespace result_of + { + template <typename Sequence, typename State, typename Fun> + struct segmented_fold_until + { + typedef + detail::segmented_fold_until_impl< + Sequence + , State + , fusion::nil + , Fun + > + filter; + + typedef + typename filter::type + type; + }; + } + + template <typename Sequence, typename State, typename Fun> + typename + lazy_disable_if< + is_const<Sequence> + , result_of::segmented_fold_until<Sequence, State, Fun> + >::type + segmented_fold_until(Sequence& seq, State const& state, Fun const& fun) + { + typedef + typename result_of::segmented_fold_until<Sequence, State, Fun>::filter + filter; + + return filter::call(seq, state, fusion::nil(), fun); + } + + template <typename Sequence, typename State, typename Fun> + typename result_of::segmented_fold_until<Sequence const, State, Fun>::type + segmented_fold_until(Sequence const& seq, State const& state, Fun const& fun) + { + typedef + typename result_of::segmented_fold_until<Sequence const, State, Fun>::filter + filter; + + return filter::call(seq, state, fusion::nil(), fun); + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/sequence_base.hpp b/3rdParty/Boost/src/boost/fusion/support/sequence_base.hpp new file mode 100644 index 0000000..89affab --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/sequence_base.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2007 Tobias Schwinger + + 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_SEQUENCE_BASE_04182005_0737) +#define FUSION_SEQUENCE_BASE_04182005_0737 + +#include <boost/mpl/begin_end_fwd.hpp> + +namespace boost { namespace fusion +{ + namespace detail + { + struct from_sequence_convertible_type + {}; + } + + template <typename Sequence> + struct sequence_base + { + Sequence const& + derived() const + { + return static_cast<Sequence const&>(*this); + } + + Sequence& + derived() + { + return static_cast<Sequence&>(*this); + } + + operator detail::from_sequence_convertible_type()const + { + return detail::from_sequence_convertible_type(); + } + }; + + struct fusion_sequence_tag; +}} + +namespace boost { namespace mpl +{ + // Deliberately break mpl::begin, so it doesn't lie that a Fusion sequence + // is not an MPL sequence by returning mpl::void_. + // In other words: Fusion Sequences are always MPL Sequences, but they can + // be incompletely defined. + template<> struct begin_impl< boost::fusion::fusion_sequence_tag >; +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/tag_of.hpp b/3rdParty/Boost/src/boost/fusion/support/tag_of.hpp new file mode 100644 index 0000000..a3fef3b --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/tag_of.hpp @@ -0,0 +1,82 @@ +/*============================================================================= + Copyright (c) 2001-2011 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_TAG_OF_09232005_0845) +#define FUSION_TAG_OF_09232005_0845 + +#include <boost/utility/enable_if.hpp> +#include <boost/type_traits/remove_const.hpp> +#include <boost/fusion/support/tag_of_fwd.hpp> +#include <boost/fusion/support/detail/is_mpl_sequence.hpp> +#include <boost/mpl/has_xxx.hpp> +#include <boost/mpl/identity.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/mpl/bool.hpp> +#include <boost/mpl/if.hpp> +#include <boost/config/no_tr1/utility.hpp> + +namespace boost +{ + template <typename T, std::size_t N> + class array; // forward + + namespace tuples + { + struct null_type; + + template < + class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7, class T8, class T9 + > + class tuple; + + template <class Head, class Tail> + struct cons; + } +} + +namespace boost { namespace fusion +{ + struct non_fusion_tag; + struct mpl_sequence_tag; + + namespace detail + { + BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag) + + template <typename Sequence, typename Active> + struct tag_of_impl + : mpl::if_<fusion::detail::is_mpl_sequence<Sequence>, + mpl::identity<mpl_sequence_tag>, + mpl::identity<non_fusion_tag> >::type + {}; + + template <typename Sequence> + struct tag_of_impl< + Sequence + , typename boost::enable_if<detail::has_fusion_tag<Sequence> >::type> + { + typedef typename Sequence::fusion_tag type; + }; + } + + namespace traits + { + template <typename Sequence, typename Active> + struct tag_of + : boost::fusion::detail::tag_of_impl<Sequence, Active> + {}; + } + + namespace detail + { + template<typename T> + struct tag_of + : traits::tag_of<typename remove_const<T>::type> + {}; + } +}} +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/tag_of_fwd.hpp b/3rdParty/Boost/src/boost/fusion/support/tag_of_fwd.hpp new file mode 100644 index 0000000..ba434d9 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/tag_of_fwd.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2001-2011 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(BOOST_FUSION_TAG_OF_FWD_31122005_1445) +#define BOOST_FUSION_TAG_OF_FWD_31122005_1445 + +namespace boost { namespace fusion +{ + namespace traits + { + template<typename T, typename Active = void> + struct tag_of; + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/support/void.hpp b/3rdParty/Boost/src/boost/fusion/support/void.hpp new file mode 100644 index 0000000..7650519 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/support/void.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2011 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(BOOST_FUSION_SUPPORT_VOID_20070706_2125) +#define BOOST_FUSION_SUPPORT_VOID_20070706_2125 + +namespace boost { namespace fusion +{ + struct void_ {}; +}} + +#endif |