diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-03-31 15:09:29 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-03-31 15:09:29 -0400 |
commit | 869912de45bfec53f8fd15c4f716b49ac2ca7aa4 (patch) | |
tree | 97934f62054ebb1f1c78812196f7c7bded1fc1b3 /src/third_party/boost-1.60.0/boost/fusion/view/joint_view/joint_view.hpp | |
parent | 319e895cc28b4aade6fa843583e0fd2ea96cd7a0 (diff) | |
download | mongo-869912de45bfec53f8fd15c4f716b49ac2ca7aa4.tar.gz |
SERVER-17294 Boost 1.60
Diffstat (limited to 'src/third_party/boost-1.60.0/boost/fusion/view/joint_view/joint_view.hpp')
-rw-r--r-- | src/third_party/boost-1.60.0/boost/fusion/view/joint_view/joint_view.hpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/third_party/boost-1.60.0/boost/fusion/view/joint_view/joint_view.hpp b/src/third_party/boost-1.60.0/boost/fusion/view/joint_view/joint_view.hpp new file mode 100644 index 00000000000..676cbc54dd3 --- /dev/null +++ b/src/third_party/boost-1.60.0/boost/fusion/view/joint_view/joint_view.hpp @@ -0,0 +1,83 @@ +/*============================================================================= + 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/support/config.hpp> +#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; + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + joint_view(Sequence1& in_seq1, Sequence2& in_seq2) + : seq1(in_seq1) + , seq2(in_seq2) + {} + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + first_type first() const { return fusion::begin(seq1); } + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + concat_type concat() const { return fusion::begin(seq2); } + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + 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 + + |