diff options
author | Vlad Voicu <vladv@rosedu.org> | 2012-03-02 10:01:11 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-03-09 15:04:05 (GMT) |
commit | 1c8cd160b79b6bbcec72042bdb104ba530508a93 (patch) | |
tree | cff302b81e74c557fbc9e30fd43144d981b613d0 /3rdParty/Boost/src/boost/fusion/view/filter_view | |
parent | 2944711aefec9a9dd66052440bc4f921910dd780 (diff) | |
download | swift-contrib-1c8cd160b79b6bbcec72042bdb104ba530508a93.zip swift-contrib-1c8cd160b79b6bbcec72042bdb104ba530508a93.tar.bz2 |
Added spirit to bundled boost
Diffstat (limited to '3rdParty/Boost/src/boost/fusion/view/filter_view')
12 files changed, 525 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/begin_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/begin_impl.hpp new file mode 100644 index 0000000..7d94261 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/begin_impl.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + 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_BEGIN_IMPL_05062005_0903) +#define FUSION_BEGIN_IMPL_05062005_0903 + +namespace boost { namespace fusion +{ + struct filter_view_tag; + + template <typename Category, typename First, typename Last, typename Pred> + struct filter_iterator; + + namespace extension + { + template <typename Tag> + struct begin_impl; + + template <> + struct begin_impl<filter_view_tag> + { + template <typename Sequence> + struct apply + { + typedef typename Sequence::first_type first_type; + typedef typename Sequence::last_type last_type; + typedef typename Sequence::pred_type pred_type; + typedef typename Sequence::category category; + typedef filter_iterator<category, first_type, last_type, pred_type> type; + + static type + call(Sequence& s) + { + return type(s.first()); + } + }; + }; + } +}} + +#endif + + diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/deref_data_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/deref_data_impl.hpp new file mode 100644 index 0000000..bf721b5 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/deref_data_impl.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP +#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP + +#include <boost/fusion/iterator/deref_data.hpp> + +namespace boost { namespace fusion { namespace extension +{ + template <typename> + struct deref_data_impl; + + template <> + struct deref_data_impl<filter_view_iterator_tag> + { + template <typename It> + struct apply + { + typedef typename + result_of::deref_data<typename It::first_type>::type + type; + + static type + call(It const& it) + { + return fusion::deref_data(it.first); + } + }; + }; +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/deref_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/deref_impl.hpp new file mode 100644 index 0000000..3e6447c --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/deref_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + 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_DEREF_IMPL_05062005_0905) +#define FUSION_DEREF_IMPL_05062005_0905 + +#include <boost/fusion/iterator/detail/adapt_deref_traits.hpp> + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template <typename Tag> + struct deref_impl; + + template <> + struct deref_impl<filter_view_iterator_tag> + : detail::adapt_deref_traits {}; + } +}} + +#endif + + diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/end_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/end_impl.hpp new file mode 100644 index 0000000..baabbd4 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/end_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + 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_END_IMPL_05062005_0906) +#define FUSION_END_IMPL_05062005_0906 + +namespace boost { namespace fusion +{ + struct filter_view_tag; + + template <typename Category, typename First, typename Last, typename Pred> + struct filter_iterator; + + namespace extension + { + template <typename Tag> + struct end_impl; + + template <> + struct end_impl<filter_view_tag> + { + template <typename Sequence> + struct apply + { + typedef typename Sequence::last_type last_type; + typedef typename Sequence::pred_type pred_type; + typedef typename Sequence::category category; + typedef filter_iterator<category,last_type, last_type, pred_type> type; + + static type + call(Sequence& s) + { + return type(s.last()); + } + }; + }; + } +}} + +#endif + + diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/equal_to_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/equal_to_impl.hpp new file mode 100644 index 0000000..5d7b293 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/equal_to_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_EQUAL_TO_IMPL_02012005_2133) +#define BOOST_FUSION_EQUAL_TO_IMPL_02012005_2133 + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template<typename I1, typename I2> + struct equal_to; + + template<typename Tag> + struct equal_to_impl; + + template<> + struct equal_to_impl<filter_view_iterator_tag> + { + template<typename I1, typename I2> + struct apply + : result_of::equal_to<typename I1::first_type, typename I2::first_type> + {}; + }; + } +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/key_of_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/key_of_impl.hpp new file mode 100644 index 0000000..09d9112 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/key_of_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP +#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP + +#include <boost/fusion/iterator/key_of.hpp> + +namespace boost { namespace fusion { namespace extension +{ + template <typename> + struct key_of_impl; + + template <> + struct key_of_impl<filter_view_iterator_tag> + { + template <typename It> + struct apply + : result_of::key_of<typename It::first_type> + {}; + }; +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/next_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/next_impl.hpp new file mode 100644 index 0000000..a436bfc --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/next_impl.hpp @@ -0,0 +1,77 @@ +/*============================================================================= + 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_NEXT_IMPL_06052005_0900) +#define FUSION_NEXT_IMPL_06052005_0900 + +#include <boost/fusion/algorithm/query/detail/find_if.hpp> +#include <boost/fusion/iterator/value_of.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/identity.hpp> +#include <boost/mpl/lambda.hpp> +#include <boost/mpl/quote.hpp> +#include <boost/mpl/bind.hpp> +#include <boost/mpl/placeholders.hpp> + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + + template <typename Category, typename First, typename Last, typename Pred> + struct filter_iterator; + + namespace extension + { + template <typename Tag> + struct next_impl; + + template <> + struct next_impl<filter_view_iterator_tag> + { + template <typename Iterator> + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename Iterator::last_type last_type; + typedef typename Iterator::pred_type pred_type; + typedef typename Iterator::category category; + + typedef typename + mpl::eval_if< + result_of::equal_to<first_type, last_type> + , mpl::identity<last_type> + , result_of::next<first_type> + >::type + next_type; + + typedef typename + detail::static_find_if< + next_type + , last_type + , mpl::bind1< + typename mpl::lambda<pred_type>::type + , mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1> + > + > + filter; + + typedef filter_iterator< + category, typename filter::type, last_type, pred_type> + type; + + static type + call(Iterator const& i) + { + return type(filter::call(i.first)); + } + }; + }; + } +}} + +#endif + + diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/size_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/size_impl.hpp new file mode 100644 index 0000000..1c5a0ac --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/size_impl.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + 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_SIZE_IMPL_09232005_1058) +#define FUSION_SIZE_IMPL_09232005_1058 + +#include <boost/fusion/iterator/distance.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/sequence/intrinsic/end.hpp> + +namespace boost { namespace fusion +{ + struct filter_view_tag; + + namespace extension + { + template <typename Tag> + struct size_impl; + + template <> + struct size_impl<filter_view_tag> + { + template <typename Sequence> + struct apply + : result_of::distance< + typename result_of::begin<Sequence>::type + , typename result_of::end<Sequence>::type> + {}; + }; + } +}} + +#endif + + diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp new file mode 100644 index 0000000..38d1bdc --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP + +#include <boost/fusion/iterator/value_of_data.hpp> + +namespace boost { namespace fusion { namespace extension +{ + template <typename> + struct value_of_data_impl; + + template <> + struct value_of_data_impl<filter_view_iterator_tag> + { + template <typename It> + struct apply + : result_of::value_of_data<typename It::first_type> + {}; + }; +}}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/value_of_impl.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/value_of_impl.hpp new file mode 100644 index 0000000..f9188f6 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/detail/value_of_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + 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_VALUE_OF_IMPL_05062005_0857) +#define FUSION_VALUE_OF_IMPL_05062005_0857 + +#include <boost/fusion/iterator/detail/adapt_value_traits.hpp> + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template <typename Tag> + struct value_of_impl; + + template <> + struct value_of_impl<filter_view_iterator_tag> + : detail::adapt_value_traits {}; + } +}} + +#endif + + diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/filter_view.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/filter_view.hpp new file mode 100644 index 0000000..76ce031 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/filter_view.hpp @@ -0,0 +1,64 @@ +/*============================================================================= + 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_SEQUENCE_FILTER_VIEW_HPP) +#define FUSION_SEQUENCE_FILTER_VIEW_HPP + +#include <boost/fusion/support/detail/access.hpp> +#include <boost/fusion/support/sequence_base.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/fusion/view/filter_view/filter_view_iterator.hpp> +#include <boost/fusion/view/filter_view/detail/begin_impl.hpp> +#include <boost/fusion/view/filter_view/detail/end_impl.hpp> +#include <boost/fusion/view/filter_view/detail/size_impl.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/sequence/intrinsic/end.hpp> +#include <boost/mpl/bool.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/inherit.hpp> +#include <boost/mpl/identity.hpp> + +namespace boost { namespace fusion +{ + struct filter_view_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template <typename Sequence, typename Pred> + struct filter_view : sequence_base<filter_view<Sequence, Pred> > + { + typedef filter_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef typename + mpl::eval_if< + traits::is_associative<Sequence> + , mpl::inherit2<forward_traversal_tag,associative_tag> + , mpl::identity<forward_traversal_tag> + >::type + category; + typedef mpl::true_ is_view; + + typedef typename result_of::begin<Sequence>::type first_type; + typedef typename result_of::end<Sequence>::type last_type; + typedef Pred pred_type; + + filter_view(Sequence& in_seq) + : seq(in_seq) + {} + + first_type first() const { return fusion::begin(seq); } + last_type last() const { return fusion::end(seq); } + typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq; + + private: + // silence MSVC warning C4512: assignment operator could not be generated + filter_view& operator= (filter_view const&); + }; +}} + +#endif + + diff --git a/3rdParty/Boost/src/boost/fusion/view/filter_view/filter_view_iterator.hpp b/3rdParty/Boost/src/boost/fusion/view/filter_view/filter_view_iterator.hpp new file mode 100644 index 0000000..8ce63cb --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/filter_view/filter_view_iterator.hpp @@ -0,0 +1,70 @@ +/*============================================================================= + 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_VIEW_ITERATOR_05062005_0849) +#define FUSION_FILTER_VIEW_ITERATOR_05062005_0849 + +#include <boost/fusion/iterator/mpl/convert_iterator.hpp> +#include <boost/fusion/adapted/mpl/mpl_iterator.hpp> +#include <boost/fusion/iterator/value_of.hpp> +#include <boost/fusion/support/iterator_base.hpp> +#include <boost/fusion/algorithm/query/detail/find_if.hpp> +#include <boost/mpl/lambda.hpp> +#include <boost/mpl/quote.hpp> +#include <boost/mpl/bind.hpp> +#include <boost/mpl/placeholders.hpp> + +#include <boost/fusion/view/filter_view/detail/deref_impl.hpp> +#include <boost/fusion/view/filter_view/detail/next_impl.hpp> +#include <boost/fusion/view/filter_view/detail/value_of_impl.hpp> +#include <boost/fusion/view/filter_view/detail/equal_to_impl.hpp> +#include <boost/fusion/view/filter_view/detail/deref_data_impl.hpp> +#include <boost/fusion/view/filter_view/detail/value_of_data_impl.hpp> +#include <boost/fusion/view/filter_view/detail/key_of_impl.hpp> + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + struct forward_traversal_tag; + + template <typename Category, typename First, typename Last, typename Pred> + struct filter_iterator : iterator_base<filter_iterator<Category, First, Last, Pred> > + { + typedef convert_iterator<First> first_converter; + typedef typename first_converter::type first_iter; + typedef convert_iterator<Last> last_converter; + typedef typename last_converter::type last_iter; + + typedef filter_view_iterator_tag fusion_tag; + typedef Category category; + typedef + detail::static_find_if< + first_iter + , last_iter + , mpl::bind1< + typename mpl::lambda<Pred>::type + , mpl::bind1<mpl::quote1<result_of::value_of>,mpl::_1> + > + > + filter; + typedef typename filter::type first_type; + typedef last_iter last_type; + typedef Pred pred_type; + + filter_iterator(First const& in_first) + : first(filter::call(first_converter::call(in_first))) {} + + first_type first; + + private: + // silence MSVC warning C4512: assignment operator could not be generated + filter_iterator& operator= (filter_iterator const&); + }; +}} + +#endif + + |