Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:10

0001 // Boost.Bimap
0002 //
0003 // Copyright (c) 2006-2007 Matias Capeletto
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 /// \file views/multiset_view.hpp
0010 /// \brief View of a bimap that is signature compatible with std::multiset.
0011 
0012 #ifndef BOOST_BIMAP_VIEWS_MULTISET_VIEW_HPP
0013 #define BOOST_BIMAP_VIEWS_MULTISET_VIEW_HPP
0014 
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018 
0019 #include <boost/config.hpp>
0020 
0021 #include <boost/bimap/container_adaptor/multiset_adaptor.hpp>
0022 #include <boost/bimap/container_adaptor/detail/comparison_adaptor.hpp>
0023 #include <boost/bimap/detail/non_unique_views_helper.hpp>
0024 #include <boost/bimap/detail/set_view_base.hpp>
0025 
0026 namespace boost {
0027 namespace bimaps {
0028 namespace views {
0029 
0030 /// \brief View of a bimap that is signature compatible with std::multiset.
0031 /**
0032 
0033 This class uses container_adaptor and iterator_adaptor to wrapped a index of the
0034 multi_index bimap core so it can be used as a std::multiset.
0035 
0036 See also const_multiset_view.
0037                                                                                     **/
0038 
0039 template< class CoreIndex >
0040 class multiset_view
0041 :
0042     public BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
0043         multiset_adaptor,
0044         CoreIndex,
0045         reverse_iterator,
0046         const_reverse_iterator
0047     ),
0048 
0049     public ::boost::bimaps::detail::
0050                 set_view_base< multiset_view< CoreIndex >, CoreIndex >
0051 {
0052     BOOST_BIMAP_SET_VIEW_BASE_FRIEND(multiset_view, CoreIndex)
0053 
0054     typedef BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
0055         multiset_adaptor,
0056         CoreIndex,
0057         reverse_iterator,
0058         const_reverse_iterator
0059 
0060     ) base_;
0061 
0062     public:
0063 
0064     multiset_view(BOOST_DEDUCED_TYPENAME base_::base_type & c) : base_(c) {}
0065 
0066     /*
0067     template< class LowerBounder, class UpperBounder >
0068     std::pair<BOOST_DEDUCED_TYPENAME base_::const_iterator,
0069               BOOST_DEDUCED_TYPENAME base_::const_iterator>
0070         range(LowerBounder lower,UpperBounder upper) const
0071     {
0072         return this->base().range(
0073 
0074             ::boost::bimaps::container_adaptor::detail::unary_check_adaptor
0075             <
0076                 LowerBounder,
0077                 BOOST_DEDUCED_TYPENAME base_::base_type::value_type,
0078                 BOOST_DEDUCED_TYPENAME base_::value_from_base
0079 
0080             >( lower, this->template functor<
0081                             BOOST_DEDUCED_TYPENAME base_::value_from_base>() ),
0082 
0083             ::boost::bimaps::container_adaptor::detail::unary_check_adaptor
0084             <
0085                 UpperBounder,
0086                 BOOST_DEDUCED_TYPENAME base_::base_type::value_type,
0087                 BOOST_DEDUCED_TYPENAME base_::value_from_base
0088 
0089             >( upper, this->template functor<
0090                             BOOST_DEDUCED_TYPENAME base_::value_from_base>() )
0091 
0092         );
0093     }
0094     */
0095 
0096     multiset_view & operator=(const multiset_view & v) 
0097     {
0098         this->base() = v.base(); return *this;
0099     }
0100 
0101     BOOST_BIMAP_NON_UNIQUE_VIEW_INSERT_FUNCTIONS
0102 };
0103 
0104 
0105 } // namespace views
0106 } // namespace bimaps
0107 } // namespace boost
0108 
0109 #endif // BOOST_BIMAP_VIEWS_MULTISET_VIEW_HPP
0110