Chris@16: // Boost.Bimap Chris@16: // Chris@16: // Copyright (c) 2006-2007 Matias Capeletto Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: /// \file views/unordered_set_view.hpp Chris@16: /// \brief View of a bimap that is signature compatible with tr1::unordered_set. Chris@16: Chris@16: #ifndef BOOST_BIMAP_VIEWS_UNORDERED_SET_VIEW_HPP Chris@16: #define BOOST_BIMAP_VIEWS_UNORDERED_SET_VIEW_HPP Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace bimaps { Chris@16: namespace views { Chris@16: Chris@16: /// \brief View of a bimap that is signature compatible with std::unordered_set. Chris@16: /** Chris@16: Chris@16: This class uses container_adaptor and iterator_adaptor to wrapped a index of the Chris@16: multi_index bimap core so it can be used as a std::unordered_set. Chris@16: Chris@16: See also const_unordered_set_view. Chris@16: **/ Chris@16: Chris@16: template< class CoreIndex > Chris@16: class unordered_set_view Chris@16: : Chris@16: public BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR( Chris@16: unordered_set_adaptor, Chris@16: CoreIndex, Chris@16: local_iterator, Chris@16: const_local_iterator Chris@16: ), Chris@16: Chris@16: public ::boost::bimaps::detail:: Chris@16: set_view_base< unordered_set_view< CoreIndex >, CoreIndex > Chris@16: { Chris@16: BOOST_BIMAP_SET_VIEW_BASE_FRIEND(unordered_set_view,CoreIndex) Chris@16: Chris@16: typedef BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR( Chris@16: unordered_set_adaptor, Chris@16: CoreIndex, Chris@16: local_iterator, Chris@16: const_local_iterator Chris@16: Chris@16: ) base_; Chris@16: Chris@16: public: Chris@16: Chris@16: unordered_set_view(BOOST_DEDUCED_TYPENAME base_::base_type & c) Chris@16: : base_(c) {} Chris@16: Chris@16: unordered_set_view & operator=(const unordered_set_view & v) Chris@16: { Chris@16: this->base() = v.base(); Chris@16: return *this; Chris@16: } Chris@16: }; Chris@16: Chris@16: Chris@16: } // namespace views Chris@16: } // namespace bimaps Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_BIMAP_VIEWS_UNORDERED_SET_VIEW_HPP Chris@16: