|
||||
File indexing completed on 2024-11-15 09:04:01
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/set_view.hpp 0010 /// \brief View of a bimap that is signature compatible with std::set. 0011 0012 #ifndef BOOST_BIMAP_VIEWS_SET_VIEW_HPP 0013 #define BOOST_BIMAP_VIEWS_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/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::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::set. 0033 0034 See also const_set_view. 0035 **/ 0036 0037 template< class CoreIndex > 0038 class set_view 0039 : 0040 public BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR( 0041 set_adaptor, 0042 CoreIndex, 0043 reverse_iterator, const_reverse_iterator 0044 ), 0045 0046 public ::boost::bimaps::detail:: 0047 set_view_base< set_view< CoreIndex >, CoreIndex > 0048 { 0049 typedef BOOST_BIMAP_SET_VIEW_CONTAINER_ADAPTOR( 0050 set_adaptor, 0051 CoreIndex, 0052 reverse_iterator, const_reverse_iterator 0053 0054 ) base_; 0055 0056 BOOST_BIMAP_SET_VIEW_BASE_FRIEND(set_view,CoreIndex) 0057 0058 public: 0059 0060 set_view(BOOST_DEDUCED_TYPENAME base_::base_type & c) : base_(c) {} 0061 0062 /* 0063 template< class LowerBounder, class UpperBounder > 0064 std::pair<BOOST_DEDUCED_TYPENAME base_::const_iterator, 0065 BOOST_DEDUCED_TYPENAME base_::const_iterator> 0066 range(LowerBounder lower,UpperBounder upper) const 0067 { 0068 return this->base().range( 0069 0070 ::boost::bimaps::container_adaptor::detail::unary_check_adaptor 0071 < 0072 LowerBounder, 0073 BOOST_DEDUCED_TYPENAME base_::base_type::value_type, 0074 BOOST_DEDUCED_TYPENAME base_::value_from_base 0075 0076 >( lower, this->template functor< 0077 BOOST_DEDUCED_TYPENAME base_::value_from_base>() ), 0078 0079 ::boost::bimaps::container_adaptor::detail::unary_check_adaptor 0080 < 0081 UpperBounder, 0082 BOOST_DEDUCED_TYPENAME base_::base_type::value_type, 0083 BOOST_DEDUCED_TYPENAME base_::value_from_base 0084 0085 >( upper, this->template functor< 0086 BOOST_DEDUCED_TYPENAME base_::value_from_base>() ) 0087 0088 ); 0089 } 0090 */ 0091 0092 set_view & operator=(const set_view & v) 0093 { 0094 this->base() = v.base(); 0095 return *this; 0096 } 0097 }; 0098 0099 0100 } // namespace views 0101 } // namespace bimaps 0102 } // namespace boost 0103 0104 #endif // BOOST_BIMAP_VIEWS_SET_VIEW_HPP 0105 0106
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |