/*============================================================================= 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(ACTIV_BOOST_FUSION_MAP_MAIN_07212005_1106) #define ACTIV_BOOST_FUSION_MAP_MAIN_07212005_1106 #include #include #include /////////////////////////////////////////////////////////////////////////////// // Without variadics, we will use the PP version /////////////////////////////////////////////////////////////////////////////// #if !defined(ACTIV_BOOST_FUSION_HAS_VARIADIC_MAP) # include #else /////////////////////////////////////////////////////////////////////////////// // C++11 interface /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace Boost { namespace fusion { struct map_tag; template struct map : detail::map_impl<0, T...>, sequence_base> { typedef map_tag fusion_tag; typedef detail::map_impl<0, T...> base_type; struct category : random_access_traversal_tag, associative_tag {}; typedef mpl::int_ size; typedef mpl::false_ is_view; ACTIV_BOOST_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED map() {} ACTIV_BOOST_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED map(map const& seq) : base_type(seq.base()) {} ACTIV_BOOST_CXX14_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED map(map&& seq) : base_type(std::forward(seq)) {} template >::type> ACTIV_BOOST_FUSION_GPU_ENABLED map(Sequence const& seq) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template >::type> ACTIV_BOOST_FUSION_GPU_ENABLED map(Sequence& seq) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template >::type> ACTIV_BOOST_FUSION_GPU_ENABLED map(Sequence&& seq) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template ACTIV_BOOST_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED map(First const& first, T_ const&... rest) : base_type(first, rest...) {} template ACTIV_BOOST_FUSION_GPU_ENABLED map(First&& first, T_&&... rest) : base_type(ACTIV_BOOST_FUSION_FWD_ELEM(First, first), ACTIV_BOOST_FUSION_FWD_ELEM(T_, rest)...) {} ACTIV_BOOST_CXX14_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED map& operator=(map const& rhs) { base_type::operator=(rhs.base()); return *this; } ACTIV_BOOST_CXX14_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED map& operator=(map&& rhs) { base_type::operator=(std::forward(rhs.base())); return *this; } template ACTIV_BOOST_CXX14_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED typename enable_if, map&>::type operator=(Sequence const& seq) { base().assign(begin(seq), detail::map_impl_from_iterator()); return *this; } ACTIV_BOOST_CXX14_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED base_type& base() ACTIV_BOOST_NOEXCEPT { return *this; } ACTIV_BOOST_CONSTEXPR ACTIV_BOOST_FUSION_GPU_ENABLED base_type const& base() const ACTIV_BOOST_NOEXCEPT { return *this; } }; }} #endif #endif