fix doc example typo
[boost.git] / boost / fusion / container / map / map.hpp
blob5f5fb1cc5f42ab37b9ece51ca75effc2712e0d5e
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_MAP_07212005_1106)
8 #define FUSION_MAP_07212005_1106
10 #include <boost/fusion/support/pair.hpp>
11 #include <boost/fusion/support/category_of.hpp>
12 #include <boost/fusion/support/detail/access.hpp>
13 #include <boost/fusion/container/map/map_fwd.hpp>
14 #include <boost/fusion/container/map/detail/lookup_key.hpp>
15 #include <boost/fusion/container/map/detail/begin_impl.hpp>
16 #include <boost/fusion/container/map/detail/end_impl.hpp>
17 #include <boost/fusion/container/map/detail/at_key_impl.hpp>
18 #include <boost/fusion/container/map/detail/value_at_key_impl.hpp>
19 #include <boost/fusion/container/vector/vector.hpp>
20 #include <boost/mpl/identity.hpp>
21 #include <boost/mpl/bool.hpp>
23 namespace boost { namespace fusion
25 struct void_;
26 struct map_tag;
27 struct fusion_sequence_tag;
29 template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_MAP_SIZE, typename T)>
30 struct map : sequence_base<map<BOOST_PP_ENUM_PARAMS(FUSION_MAX_MAP_SIZE, T)> >
32 struct category : forward_traversal_tag, associative_sequence_tag {};
34 typedef map_tag fusion_tag;
35 typedef fusion_sequence_tag tag; // this gets picked up by MPL
36 typedef mpl::false_ is_view;
38 typedef vector<
39 BOOST_PP_ENUM_PARAMS(FUSION_MAX_MAP_SIZE, T)>
40 storage_type;
42 typedef typename storage_type::size size;
44 map()
45 : data() {}
47 template <typename Sequence>
48 map(Sequence const& rhs)
49 : data(rhs) {}
51 #include <boost/fusion/container/map/detail/map_forward_ctor.hpp>
52 #include <boost/fusion/container/map/detail/map_lookup.hpp>
54 template <typename T>
55 map&
56 operator=(T const& rhs)
58 data = rhs;
59 return *this;
62 storage_type& get_data() { return data; }
63 storage_type const& get_data() const { return data; }
65 private:
67 storage_type data;
71 #endif