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/view/joint_view/joint_view.hpp | |
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/view/joint_view/joint_view.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/fusion/view/joint_view/joint_view.hpp | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/fusion/view/joint_view/joint_view.hpp b/3rdParty/Boost/src/boost/fusion/view/joint_view/joint_view.hpp new file mode 100644 index 0000000..11b74f9 --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/joint_view/joint_view.hpp @@ -0,0 +1,78 @@ +/*============================================================================= + 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_JOINT_VIEW_07162005_0140) +#define FUSION_JOINT_VIEW_07162005_0140 + +#include <boost/fusion/view/joint_view/joint_view_fwd.hpp> +#include <boost/fusion/support/detail/access.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/sequence/intrinsic/end.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/fusion/view/joint_view/joint_view_iterator.hpp> +#include <boost/fusion/view/joint_view/detail/begin_impl.hpp> +#include <boost/fusion/view/joint_view/detail/end_impl.hpp> +#include <boost/fusion/support/sequence_base.hpp> +#include <boost/mpl/if.hpp> +#include <boost/mpl/plus.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 joint_view_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template <typename Sequence1, typename Sequence2> + struct joint_view : sequence_base<joint_view<Sequence1, Sequence2> > + { + typedef joint_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef typename + mpl::eval_if< + mpl::and_< + traits::is_associative<Sequence1> + , traits::is_associative<Sequence2> + > + , mpl::inherit2<forward_traversal_tag,associative_tag> + , mpl::identity<forward_traversal_tag> + >::type + category; + typedef mpl::true_ is_view; + + typedef typename result_of::begin<Sequence1>::type first_type; + typedef typename result_of::end<Sequence1>::type last_type; + typedef typename result_of::begin<Sequence2>::type concat_type; + typedef typename result_of::end<Sequence2>::type concat_last_type; + typedef typename mpl::int_< + result_of::size<Sequence1>::value + result_of::size<Sequence2>::value> + size; + + joint_view(Sequence1& in_seq1, Sequence2& in_seq2) + : seq1(in_seq1) + , seq2(in_seq2) + {} + + first_type first() const { return fusion::begin(seq1); } + concat_type concat() const { return fusion::begin(seq2); } + concat_last_type concat_last() const { return fusion::end(seq2); } + + private: + // silence MSVC warning C4512: assignment operator could not be generated + joint_view& operator= (joint_view const&); + + typename mpl::if_<traits::is_view<Sequence1>, Sequence1, Sequence1&>::type seq1; + typename mpl::if_<traits::is_view<Sequence2>, Sequence2, Sequence2&>::type seq2; + }; +}} + +#endif + + |