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/detail/access.hpp>
12 #include <boost/fusion/support/detail/as_fusion_element.hpp>
13 #include <boost/fusion/support/sequence_base.hpp>
14 #include <boost/fusion/view/single_view/single_view_iterator.hpp>
15 #include <boost/fusion/view/single_view/detail/at_impl.hpp>
16 #include <boost/fusion/view/single_view/detail/begin_impl.hpp>
17 #include <boost/fusion/view/single_view/detail/end_impl.hpp>
18 #include <boost/fusion/view/single_view/detail/size_impl.hpp>
19 #include <boost/fusion/view/single_view/detail/value_at_impl.hpp>
20 #include <boost/mpl/bool.hpp>
21 #include <boost/mpl/int.hpp>
22 #include <boost/config.hpp>
24 #if defined (BOOST_MSVC)
25 # pragma warning(push)
26 # pragma warning (disable: 4512) // assignment operator could not be generated.
29 namespace boost { namespace fusion
31 struct single_view_tag;
32 struct random_access_traversal_tag;
33 struct fusion_sequence_tag;
36 struct single_view : sequence_base<single_view<T> >
38 typedef single_view_tag fusion_tag;
39 typedef fusion_sequence_tag tag; // this gets picked up by MPL
40 typedef random_access_traversal_tag category;
41 typedef mpl::true_ is_view;
42 typedef mpl::int_<1> size;
48 explicit single_view(typename detail::call_param<T>::type in_val)
55 inline single_view<typename detail::as_fusion_element<T>::type>
56 make_single_view(T const& v)
58 return single_view<typename detail::as_fusion_element<T>::type>(v);
62 #if defined (BOOST_MSVC)