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/unordered_set_view.hpp
0010 /// \brief View of a bimap that is signature compatible with tr1::unordered_set.
0011 
0012 #ifndef BOOST_BIMAP_VIEWS_UNORDERED_SET_VIEW_HPP
0013 #define BOOST_BIMAP_VIEWS_UNORDERED_SET_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/unordered_set_adaptor.hpp>
0022 #include <boost/bimap/detail/set_view_base.hpp>
0023 
0024 namespace boost {
0025 namespace bimaps {
0026 namespace views {
0027 
0028 /// \brief View of a bimap that is signature compatible with std::unordered_set.
0029 /**
0030 
0031 This class uses container_adaptor and iterator_adaptor to wrapped a index of the
0032 multi_index bimap core so it can be used as a std::unordered_set.
0033 
0034 See also const_unordered_set_view.
0035                                                                              **/
0036 
0037 template< class CoreIndex >
0038 class unordered_set_view
0039 :
0040     public BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
0041         unordered_set_adaptor,
0042         CoreIndex,
0043         local_iterator,
0044         const_local_iterator
0045     ),
0046 
0047     public ::boost::bimaps::detail::
0048         set_view_base< unordered_set_view< CoreIndex >, CoreIndex >
0049 {
0050     BOOST_BIMAP_SET_VIEW_BASE_FRIEND(unordered_set_view,CoreIndex)
0051 
0052     typedef BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR(
0053         unordered_set_adaptor,
0054         CoreIndex,
0055         local_iterator,
0056         const_local_iterator
0057 
0058     ) base_;
0059 
0060     public:
0061 
0062     unordered_set_view(BOOST_DEDUCED_TYPENAME base_::base_type & c)
0063         : base_(c) {}
0064 
0065     unordered_set_view & operator=(const unordered_set_view & v) 
0066     {
0067         this->base() = v.base();
0068         return *this;
0069     }
0070 };
0071 
0072 
0073 } // namespace views
0074 } // namespace bimaps
0075 } // namespace boost
0076 
0077 #endif // BOOST_BIMAP_VIEWS_UNORDERED_SET_VIEW_HPP
0078