Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:33:39

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 #if !defined(FUSION_MAP_MAIN_07212005_1106)
0008 #define FUSION_MAP_MAIN_07212005_1106
0009 
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/container/map/map_fwd.hpp>
0012 #include <boost/fusion/support/pair.hpp>
0013 
0014 ///////////////////////////////////////////////////////////////////////////////
0015 // Without variadics, we will use the PP version
0016 ///////////////////////////////////////////////////////////////////////////////
0017 #if !defined(BOOST_FUSION_HAS_VARIADIC_MAP)
0018 # include <boost/fusion/container/map/detail/cpp03/map.hpp>
0019 #else
0020 
0021 ///////////////////////////////////////////////////////////////////////////////
0022 // C++11 interface
0023 ///////////////////////////////////////////////////////////////////////////////
0024 #include <boost/fusion/container/map/detail/map_impl.hpp>
0025 #include <boost/fusion/container/map/detail/begin_impl.hpp>
0026 #include <boost/fusion/container/map/detail/end_impl.hpp>
0027 #include <boost/fusion/container/map/detail/at_impl.hpp>
0028 #include <boost/fusion/container/map/detail/at_key_impl.hpp>
0029 #include <boost/fusion/container/map/detail/value_at_impl.hpp>
0030 #include <boost/fusion/container/map/detail/value_at_key_impl.hpp>
0031 #include <boost/fusion/sequence/intrinsic/begin.hpp>
0032 #include <boost/fusion/sequence/intrinsic/end.hpp>
0033 #include <boost/fusion/sequence/intrinsic/at.hpp>
0034 #include <boost/fusion/sequence/intrinsic/at_c.hpp>
0035 #include <boost/fusion/support/is_sequence.hpp>
0036 #include <boost/fusion/support/sequence_base.hpp>
0037 #include <boost/fusion/support/category_of.hpp>
0038 #include <boost/fusion/support/void.hpp>
0039 #include <boost/fusion/support/detail/enabler.hpp>
0040 
0041 #include <boost/utility/enable_if.hpp>
0042 
0043 namespace boost { namespace fusion
0044 {
0045     struct map_tag;
0046 
0047     template <typename ...T>
0048     struct map : detail::map_impl<0, T...>, sequence_base<map<T...>>
0049     {
0050         typedef map_tag fusion_tag;
0051         typedef detail::map_impl<0, T...> base_type;
0052 
0053         struct category : random_access_traversal_tag, associative_tag {};
0054         typedef mpl::int_<base_type::size> size;
0055         typedef mpl::false_ is_view;
0056 
0057         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0058         map() {}
0059 
0060         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0061         map(map const& seq)
0062           : base_type(seq.base())
0063         {}
0064 
0065         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0066         map(map&& seq)
0067           : base_type(std::forward<map>(seq))
0068         {}
0069 
0070         template <typename Sequence, typename = typename enable_if<traits::is_sequence<Sequence>>::type>
0071         BOOST_FUSION_GPU_ENABLED
0072         map(Sequence const& seq)
0073           : base_type(begin(seq), detail::map_impl_from_iterator())
0074         {}
0075 
0076         template <typename Sequence, typename = typename enable_if<traits::is_sequence<Sequence>>::type>
0077         BOOST_FUSION_GPU_ENABLED
0078         map(Sequence& seq)
0079           : base_type(begin(seq), detail::map_impl_from_iterator())
0080         {}
0081 
0082         template <typename Sequence, typename = typename enable_if<traits::is_sequence<Sequence>>::type>
0083         BOOST_FUSION_GPU_ENABLED
0084         map(Sequence&& seq)
0085           : base_type(begin(seq), detail::map_impl_from_iterator())
0086         {}
0087 
0088         template <typename First, typename ...T_>
0089         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0090         map(First const& first, T_ const&... rest)
0091           : base_type(first, rest...)
0092         {}
0093 
0094         template <typename First, typename ...T_>
0095         BOOST_FUSION_GPU_ENABLED
0096         map(First&& first, T_&&... rest)
0097           : base_type(BOOST_FUSION_FWD_ELEM(First, first), BOOST_FUSION_FWD_ELEM(T_, rest)...)
0098         {}
0099 
0100         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0101         map& operator=(map const& rhs)
0102         {
0103             base_type::operator=(rhs.base());
0104             return *this;
0105         }
0106 
0107         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0108         map& operator=(map&& rhs)
0109         {
0110             base_type::operator=(std::forward<base_type>(rhs.base()));
0111             return *this;
0112         }
0113 
0114         template <typename Sequence>
0115         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0116         typename enable_if<traits::is_sequence<Sequence>, map&>::type
0117         operator=(Sequence const& seq)
0118         {
0119             base().assign(begin(seq), detail::map_impl_from_iterator());
0120             return *this;
0121         }
0122 
0123         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0124         base_type& base() BOOST_NOEXCEPT { return *this; }
0125         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0126         base_type const& base() const BOOST_NOEXCEPT { return *this; }
0127     };
0128 }}
0129 
0130 #endif
0131 #endif