Chris@16
|
1 // Boost.Bimap
|
Chris@16
|
2 //
|
Chris@16
|
3 // Copyright (c) 2006-2007 Matias Capeletto
|
Chris@16
|
4 //
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
6 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8
|
Chris@16
|
9 /// \file views/unordered_multiset_view.hpp
|
Chris@16
|
10 /// \brief View of a bimap that is signature compatible with tr1::unordered_multiset.
|
Chris@16
|
11
|
Chris@16
|
12 #ifndef BOOST_BIMAP_VIEWS_UNORDERED_MULTISET_VIEW_HPP
|
Chris@16
|
13 #define BOOST_BIMAP_VIEWS_UNORDERED_MULTISET_VIEW_HPP
|
Chris@16
|
14
|
Chris@101
|
15 #if defined(_MSC_VER)
|
Chris@16
|
16 #pragma once
|
Chris@16
|
17 #endif
|
Chris@16
|
18
|
Chris@16
|
19 #include <boost/config.hpp>
|
Chris@16
|
20
|
Chris@16
|
21 #include <boost/bimap/container_adaptor/unordered_multiset_adaptor.hpp>
|
Chris@16
|
22 #include <boost/bimap/detail/non_unique_views_helper.hpp>
|
Chris@16
|
23 #include <boost/bimap/detail/set_view_base.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 namespace boost {
|
Chris@16
|
26 namespace bimaps {
|
Chris@16
|
27 namespace views {
|
Chris@16
|
28
|
Chris@16
|
29 /// \brief View of a bimap that is signature compatible with std::unordered_multiset.
|
Chris@16
|
30 /**
|
Chris@16
|
31
|
Chris@16
|
32 This class uses container_adaptor and iterator_adaptor to wrapped a index of the
|
Chris@16
|
33 multi_index bimap core so it can be used as a std::unordered_multiset.
|
Chris@16
|
34
|
Chris@16
|
35 See also const_unordered_multiset_view.
|
Chris@16
|
36 **/
|
Chris@16
|
37
|
Chris@16
|
38 template< class CoreIndex >
|
Chris@16
|
39 class unordered_multiset_view
|
Chris@16
|
40 :
|
Chris@16
|
41 public BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
|
Chris@16
|
42 unordered_multiset_adaptor,
|
Chris@16
|
43 CoreIndex,
|
Chris@16
|
44 local_iterator,
|
Chris@16
|
45 const_local_iterator
|
Chris@16
|
46
|
Chris@16
|
47 ),
|
Chris@16
|
48
|
Chris@16
|
49 public ::boost::bimaps::detail::
|
Chris@16
|
50 set_view_base< unordered_multiset_view< CoreIndex >, CoreIndex >
|
Chris@16
|
51 {
|
Chris@16
|
52 BOOST_BIMAP_SET_VIEW_BASE_FRIEND(unordered_multiset_view,CoreIndex)
|
Chris@16
|
53
|
Chris@16
|
54 typedef BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
|
Chris@16
|
55 unordered_multiset_adaptor,
|
Chris@16
|
56 CoreIndex,
|
Chris@16
|
57 local_iterator,
|
Chris@16
|
58 const_local_iterator
|
Chris@16
|
59
|
Chris@16
|
60 ) base_;
|
Chris@16
|
61
|
Chris@16
|
62 public:
|
Chris@16
|
63
|
Chris@16
|
64 unordered_multiset_view(BOOST_DEDUCED_TYPENAME base_::base_type & c)
|
Chris@16
|
65 : base_(c) {}
|
Chris@16
|
66
|
Chris@16
|
67 BOOST_BIMAP_NON_UNIQUE_VIEW_INSERT_FUNCTIONS
|
Chris@16
|
68
|
Chris@16
|
69 unordered_multiset_view & operator=(const unordered_multiset_view & v)
|
Chris@16
|
70 {
|
Chris@16
|
71 this->base() = v.base();
|
Chris@16
|
72 return *this;
|
Chris@16
|
73 }
|
Chris@16
|
74 };
|
Chris@16
|
75
|
Chris@16
|
76
|
Chris@16
|
77 } // namespace views
|
Chris@16
|
78 } // namespace bimaps
|
Chris@16
|
79 } // namespace boost
|
Chris@16
|
80
|
Chris@16
|
81 #endif // BOOST_BIMAP_VIEWS_UNORDERED_MULTISET_VIEW_HPP
|
Chris@16
|
82
|
Chris@16
|
83
|