3 // Copyright (c) 2006-2007 Matias Capeletto
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 /// \file views/multiset_view.hpp
10 /// \brief View of a bimap that is signature compatible with std::multiset.
12 #ifndef BOOST_BIMAP_VIEWS_MULTISET_VIEW_HPP
13 #define BOOST_BIMAP_VIEWS_MULTISET_VIEW_HPP
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
19 #include <boost/config.hpp>
21 #include <boost/bimap/container_adaptor/multiset_adaptor.hpp>
22 #include <boost/bimap/container_adaptor/detail/comparison_adaptor.hpp>
23 #include <boost/bimap/detail/non_unique_views_helper.hpp>
24 #include <boost/bimap/detail/set_view_base.hpp>
30 /// \brief View of a bimap that is signature compatible with std::multiset.
33 This class uses container_adaptor and iterator_adaptor to wrapped a index of the
34 multi_index bimap core so it can be used as a std::multiset.
36 See also const_multiset_view.
39 template< class CoreIndex >
42 public BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
46 const_reverse_iterator
49 public ::boost::bimaps::detail::
50 set_view_base< multiset_view< CoreIndex >, CoreIndex >
52 BOOST_BIMAP_SET_VIEW_BASE_FRIEND(multiset_view, CoreIndex)
54 typedef BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
58 const_reverse_iterator
64 multiset_view(BOOST_DEDUCED_TYPENAME base_::base_type & c) : base_(c) {}
67 template< class LowerBounder, class UpperBounder >
68 std::pair<BOOST_DEDUCED_TYPENAME base_::const_iterator,
69 BOOST_DEDUCED_TYPENAME base_::const_iterator>
70 range(LowerBounder lower,UpperBounder upper) const
72 return this->base().range(
74 ::boost::bimaps::container_adaptor::detail::unary_check_adaptor
77 BOOST_DEDUCED_TYPENAME base_::base_type::value_type,
78 BOOST_DEDUCED_TYPENAME base_::value_from_base
80 >( lower, this->template functor<
81 BOOST_DEDUCED_TYPENAME base_::value_from_base>() ),
83 ::boost::bimaps::container_adaptor::detail::unary_check_adaptor
86 BOOST_DEDUCED_TYPENAME base_::base_type::value_type,
87 BOOST_DEDUCED_TYPENAME base_::value_from_base
89 >( upper, this->template functor<
90 BOOST_DEDUCED_TYPENAME base_::value_from_base>() )
96 multiset_view & operator=(const multiset_view & v)
98 this->base() = v.base(); return *this;
101 BOOST_BIMAP_NON_UNIQUE_VIEW_INSERT_FUNCTIONS
106 } // namespace bimaps
109 #endif // BOOST_BIMAP_VIEWS_MULTISET_VIEW_HPP