fix doc example typo
[boost.git] / boost / fusion / container / list / list.hpp
blob7516df48a36216d55ee3f849d9a8f67b86799086
1 /*=============================================================================
2 Copyright (c) 2005 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_LIST_07172005_1153)
8 #define FUSION_LIST_07172005_1153
10 #include <boost/fusion/container/list/list_fwd.hpp>
11 #include <boost/fusion/container/list/detail/list_to_cons.hpp>
13 namespace boost { namespace fusion
15 struct nil;
16 struct void_;
18 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename T)>
19 struct list
20 : detail::list_to_cons<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, T)>::type
22 private:
23 typedef
24 detail::list_to_cons<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, T)>
25 list_to_cons;
27 public:
28 typedef typename list_to_cons::type inherited_type;
30 list()
31 : inherited_type() {}
33 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename U)>
34 list(list<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, U)> const& rhs)
35 : inherited_type(rhs) {}
37 template <typename Sequence>
38 list(Sequence const& rhs)
39 : inherited_type(rhs) {}
41 // Expand a couple of forwarding constructors for arguments
42 // of type (T0), (T0, T1), (T0, T1, T2) etc. Exanple:
44 // list(
45 // typename detail::call_param<T0>::type _0
46 // , typename detail::call_param<T1>::type _1)
47 // : inherited_type(list_to_cons::call(_0, _1)) {}
48 #include <boost/fusion/container/list/detail/list_forward_ctor.hpp>
50 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename U)>
51 list&
52 operator=(list<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, U)> const& rhs)
54 inherited_type::operator=(rhs);
55 return *this;
58 template <typename T>
59 list&
60 operator=(T const& rhs)
62 inherited_type::operator=(rhs);
63 return *this;
68 #endif