1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2011 Eric Niebler
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_FUSION_SINGLE_VIEW_05052005_0335)
9 #define BOOST_FUSION_SINGLE_VIEW_05052005_0335
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/support/detail/access.hpp>
13 #include <boost/fusion/support/detail/as_fusion_element.hpp>
14 #include <boost/fusion/support/sequence_base.hpp>
15 #include <boost/fusion/view/single_view/single_view_iterator.hpp>
16 #include <boost/fusion/view/single_view/detail/at_impl.hpp>
17 #include <boost/fusion/view/single_view/detail/begin_impl.hpp>
18 #include <boost/fusion/view/single_view/detail/end_impl.hpp>
19 #include <boost/fusion/view/single_view/detail/size_impl.hpp>
20 #include <boost/fusion/view/single_view/detail/value_at_impl.hpp>
21 #include <boost/mpl/bool.hpp>
22 #include <boost/mpl/int.hpp>
23 #include <boost/config.hpp>
25 #if defined (BOOST_MSVC)
26 # pragma warning(push)
27 # pragma warning (disable: 4512) // assignment operator could not be generated.
30 namespace boost { namespace fusion
32 struct single_view_tag;
33 struct random_access_traversal_tag;
34 struct fusion_sequence_tag;
37 struct single_view : sequence_base<single_view<T> >
39 typedef single_view_tag fusion_tag;
40 typedef fusion_sequence_tag tag; // this gets picked up by MPL
41 typedef random_access_traversal_tag category;
42 typedef mpl::true_ is_view;
43 typedef mpl::int_<1> size;
46 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
50 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
51 explicit single_view(typename detail::call_param<T>::type in_val)
58 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
59 inline single_view<typename detail::as_fusion_element<T>::type>
60 make_single_view(T const& v)
62 return single_view<typename detail::as_fusion_element<T>::type>(v);
66 #if defined (BOOST_MSVC)