📄 unordered_set_of.qbk
字号:
[/licenseBoost.BimapCopyright (c) 2006-2007 Matias CapelettoDistributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or copy athttp://www.boost.org/LICENSE_1_0.txt)][/ QuickBook Document version 1.4 ][section unordered_set_of Reference][section Header "boost/bimap/unordered_set_of.hpp" synopsis] namespace boost { namespace bimaps { template < class KeyType, class HashFunctor = hash< KeyType >, class EqualKey = std::equal_to< KeyType > > struct unordered_set_of; template < class HashFunctor = hash< _relation >, class EqualKey = std::equal_to< _relation > > struct unordered_set_of_relation; } // namespace bimap } // namespace boost[endsect][section Header "boost/bimap/unordered_multiset_of.hpp" synopsis] namespace boost { namespace bimaps { template < class KeyType, class HashFunctor = hash< KeyType >, class EqualKey = std::equal_to< KeyType > > struct unordered_multiset_of; template < class HashFunctor = hash< _relation >, class EqualKey = std::equal_to< _relation > > struct unordered_multiset_of_relation; } // namespace bimap } // namespace boost[endsect][section Collection type specifiers unordered_set_of and unordered_multiset_of]These collection types specifiers allow for set views without andwith allowance of duplicate elements, respectively. The syntax of`set_of` and `multiset_of` coincide, thus we describe themin a grouped manner.[endsect][section unordered_\[multi\]set_of Views]An unordered_\[multi\]set_of set view is a tr1::unordered\[multi\]set signature compatibleinterface to the underlying heap of elements contained in a `bimap`.The interface and semantics of `unordered_[multi]set_of` views aremodeled according to the proposal for unordered associative containers givenin the __CPP_STANDARD_LIBRARY_TECHNICAL_REPORT__, also known as TR1.An `unordered_[multi]set_of` view is particularized according to a given`Hash` function object which returns hash values for the keys and abinary predicate `Pred` acting as an equivalence relation on values of Key.There are two variants: unordered_set_of, which do not allow duplicate elements(with respect to its associated comparison predicate) and unordered_multiset_of,which accept those duplicates. The interface of these two variants is the sameto a great extent, so they are documented together with their differencesexplicitly noted when they exist.If you look the bimap by a side, you will use a map view and if you lookedit as a whole you will be using a set view.Except where noted, `unordered_[multi]set_of` views (both unique and non-unique) are modelsof [^Unordered Associative Container].Validity of iterators and references to elements is preserved in all cases.Occasionally, the exception safety guarantees provided are actually strongerthan required by the extension draft. We only provide descriptions of thosetypes and operations that are either not present in the concepts modeled ordo not exactly conform to the requirements for unordered associative containers. namespace boost { namespace bimap { namespace views { template< ``['-implementation defined parameter list-]`` > class ``['-implementation defined view name-]`` { public: // types typedef ``['-unspecified-]`` key_type; typedef ``['-unspecified-]`` value_type; typedef ``['-unspecified-]`` key_compare; typedef ``['-unspecified-]`` value_compare; typedef ``['-unspecified-]`` hasher; typedef ``['-unspecified-]`` key_equal; typedef ``['-unspecified-]`` allocator_type; typedef ``['-unspecified-]`` reference; typedef ``['-unspecified-]`` const_reference; typedef ``['-unspecified-]`` iterator; typedef ``['-unspecified-]`` const_iterator; typedef ``['-unspecified-]`` size_type; typedef ``['-unspecified-]`` difference_type; typedef ``['-unspecified-]`` pointer; typedef ``['-unspecified-]`` const_pointer; typedef ``['-unspecified-]`` local_iterator; typedef ``['-unspecified-]`` const_local_iterator; typedef ``['-unspecified-]`` info_type; // construct/destroy/copy: this_type & operator=(const this_type & x); allocator_type get_allocator() const; // size and capacity bool empty() const; size_type size() const; size_type max_size() const; // iterators iterator begin(); const_iterator begin() const; iterator end(); const_iterator end() const; // modifiers std::pair< iterator, bool > ``[link reference_unordered_set_of_insert_value insert]``(const value_type & x); iterator ``[link reference_unordered_set_of_insert_iterator_value insert]``(iterator position, const value_type & x); template< class InputIterator > void ``[link reference_unordered_set_of_insert_iterator_iterator insert]``(InputIterator first, InputIterator last); iterator ``[link reference_unordered_set_of_erase_iterator erase]``(iterator position); template< class CompatibleKey > size_type ``[link reference_unordered_set_of_erase_key erase]``(const CompatibleKey & x); iterator ``[link reference_unordered_set_of_erase_iterator_iterator erase]``(iterator first, iterator last); bool ``[link reference_unordered_set_of_replace_iterator_value replace]``(iterator position, const value_type & x); // Only in map views // { template< class CompatibleKey > bool ``[link reference_unordered_set_of_replace_key_iterator_key replace_key]``(iterator position, const CompatibleKey & x); template< class CompatibleData > bool ``[link reference_unordered_set_of_replace_data_iterator_data replace_data]``(iterator position, const CompatibleData & x); template< class KeyModifier > bool ``[link reference_unordered_set_of_modify_key_iterator_modifier modify_key]``(iterator position, KeyModifier mod); template< class DataModifier > bool ``[link reference_unordered_set_of_modify_data_iterator_modifier modify_data]``(iterator position, DataModifier mod); // } void clear(); // observers key_from_value key_extractor() const; hasher hash_function() const; key_equal key_eq() const; // lookup template< class CompatibleKey > iterator ``[link reference_unordered_set_of_find_key find]``(const CompatibleKey & x); template< class CompatibleKey > const_iterator ``[link reference_unordered_set_of_find_key find]``(const CompatibleKey & x) const; template< class CompatibleKey > size_type ``[link reference_unordered_set_of_count_key count]``(const CompatibleKey & x) const; template< class CompatibleKey > std::pair<iterator,iterator> ``[link reference_unordered_set_of_equal_range_key equal_range]``(const CompatibleKey & x); template< class CompatibleKey > std::pair<const_iterator,const_iterator> ``[link reference_unordered_set_of_equal_range_key equal_range]``(const CompatibleKey & x) const; // bucket interface size_type bucket_count() const; size_type max_bucket_count() const; size_type bucket_size(size_type n) const; size_type bucket(const key_type & k) const; local_iterator begin(size_type n); const_local_iterator begin(size_type n) const; local_iterator end(size_type n); const_local_iterator end(size_type n) const; // hash policy float load_factor() const; float max_load_factor() const; void max_load_factor(float z); void ``[link reference_unordered_set_of_rehash_size rehash]``(size_type n); // Only in maps views // { typedef ``['-unspecified-]`` data_type; // Only in for `unordered_set_of` collection type // { template<class CompatibleKey> const data_type & ``[link reference_unordered_set_of_at_key_const at]``(const CompatibleKey & k) const; // Only if the other collection type is mutable // { template<class CompatibleKey> data_type & ``[link reference_unordered_set_of_operator_bracket_key operator\[\]]``(const CompatibleKey & k); template<class CompatibleKey> data_type & ``[link reference_unordered_set_of_at_key at]``(const CompatibleKey & k); // } // Only if info_hook is used // { template< class CompatibleKey > info_type & ``[link reference_unordered_set_of_info_at_key info_at]``(const CompatibleKey & k); template< class CompatibleKey > const info_type & ``[link reference_unordered_set_of_info_at_key info_at]``(const CompatibleKey & k) const; // } // } }; } // namespace views } // namespace bimap } // namespace boost
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -