Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:34:59

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003     Copyright (c) 2011 Eric Niebler
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 #if !defined(BOOST_FUSION_SINGLE_VIEW_05052005_0335)
0009 #define BOOST_FUSION_SINGLE_VIEW_05052005_0335
0010 
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/fusion/support/detail/access.hpp>
0013 #include <boost/fusion/support/detail/as_fusion_element.hpp>
0014 #include <boost/fusion/support/sequence_base.hpp>
0015 #include <boost/fusion/view/single_view/single_view_iterator.hpp>
0016 #include <boost/fusion/view/single_view/detail/at_impl.hpp>
0017 #include <boost/fusion/view/single_view/detail/begin_impl.hpp>
0018 #include <boost/fusion/view/single_view/detail/end_impl.hpp>
0019 #include <boost/fusion/view/single_view/detail/size_impl.hpp>
0020 #include <boost/fusion/view/single_view/detail/value_at_impl.hpp>
0021 #include <boost/mpl/bool.hpp>
0022 #include <boost/mpl/int.hpp>
0023 #include <boost/config.hpp>
0024 
0025 #if defined (BOOST_MSVC)
0026 #  pragma warning(push)
0027 #  pragma warning (disable: 4512) // assignment operator could not be generated.
0028 #endif
0029 
0030 namespace boost { namespace fusion
0031 {
0032     struct single_view_tag;
0033     struct random_access_traversal_tag;
0034     struct fusion_sequence_tag;
0035 
0036     template <typename T>
0037     struct single_view : sequence_base<single_view<T> >
0038     {
0039         typedef single_view_tag fusion_tag;
0040         typedef fusion_sequence_tag tag; // this gets picked up by MPL
0041         typedef random_access_traversal_tag category;
0042         typedef mpl::true_ is_view;
0043         typedef mpl::int_<1> size;
0044         typedef T value_type;
0045 
0046         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0047         single_view()
0048             : val() {}
0049 
0050         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0051         explicit single_view(typename detail::call_param<T>::type in_val)
0052             : val(in_val) {}
0053 
0054         value_type val;
0055     };
0056     
0057     template <typename T>
0058     BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0059     inline single_view<typename detail::as_fusion_element<T>::type>
0060     make_single_view(T const& v)
0061     {
0062         return single_view<typename detail::as_fusion_element<T>::type>(v);
0063     }
0064 }}
0065 
0066 #if defined (BOOST_MSVC)
0067 #  pragma warning(pop)
0068 #endif
0069 
0070 #endif
0071 
0072