📄 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 set_of Reference][section Header "boost/bimap/set_of.hpp" synopsis] namespace boost { namespace bimaps { template < class KeyType, class KeyCompare = std::less< KeyType > > struct set_of; template < class KeyCompare = std::less< _relation > > struct set_of_relation; } // namespace bimap } // namespace boost[endsect][section Header "boost/bimap/multiset_of.hpp" synopsis] namespace boost { namespace bimaps { template < class KeyType, class KeyCompare = std::less< KeyType > > struct multiset_of; template < class KeyCompare = std::less< _relation > > struct multiset_of_relation; } // namespace bimap } // namespace boost[endsect][section Collection type specifiers set_of and multiset_of]These collection type specifiers allow for insertion of sets disallowing orallowing duplicate elements, respectively. The syntaxes of `set_of` and`multiset_of` coincide, so they are described together.[endsect][section \[multi\]set_of Views]A \[multi\]set_of set view is a std::\[multi\]set signature-compatibleinterface to the underlying heap of elements contained in a `bimap`.There are two variants: set_of, which does not allow duplicate elements(with respect to its associated comparison predicate) and multiset_of,which does accept those duplicates. The interface of these two variantsis largely the same, so they are documented together with theirdifferences explicitly noted where they exist.If you look the bimap from a side, you will use a map view, and if youlook at it as a whole, you will be using a set view. namespace boost { namespace bimaps { namespace views { template< ``['-implementation defined parameter list-]`` > class ``['-implementation defined view name-]`` { public: typedef ``['-unspecified-]`` key_type; typedef ``['-unspecified-]`` value_type; typedef ``['-unspecified-]`` key_compare; typedef ``['-unspecified-]`` value_compare; 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-]`` reverse_iterator; typedef ``['-unspecified-]`` const_reverse_iterator; typedef ``['-unspecified-]`` info_type; this_type & operator=(const this_type & x); allocator_type get_allocator() const; // iterators iterator begin(); const_iterator begin() const; iterator end(); const_iterator end() const; reverse_iterator rbegin(); const_reverse_iterator rbegin() const; reverse_iterator rend(); const_reverse_iterator rend() const; // capacity bool empty() const; size_type size() const; size_type max_size() const; // modifiers std::pair<iterator,bool> ``[link reference_set_of_insert_value insert]``(const value_type & x); iterator ``[link reference_set_of_insert_iterator_value insert]``(iterator position, const value_type & x); template< class InputIterator> void ``[link reference_set_of_insert_iterator_iterator insert]``(InputIterator first, InputIterator last); iterator ``[link reference_set_of_erase_iterator erase]``(iterator position); template< class CompatibleKey > size_type ``[link reference_set_of_erase_key erase]``(const CompatibleKey & x); iterator ``[link reference_set_of_erase_iterator_iterator erase]``(iterator first, iterator last); bool ``[link reference_set_of_replace_iterator_value replace]``(iterator position, const value_type& x); // Only in map views // { template< class CompatibleKey > bool ``[link reference_set_of_replace_key_iterator_key replace_key]``(iterator position, const CompatibleKey & x); template< class CompatibleData > bool ``[link reference_set_of_replace_data_iterator_data replace_data]``(iterator position, const CompatibleData & x); template< class KeyModifier > bool ``[link reference_set_of_modify_key_iterator_modifier modify_key]``(iterator position, KeyModifier mod); template< class DataModifier > bool ``[link reference_set_of_modify_data_iterator_modifier modify_data]``(iterator position, DataModifier mod); // } void swap(this_type & x); void clear(); // observers key_compare key_comp() const; value_compare value_comp() const; // set operations template< class CompatibleKey > iterator ``[link reference_set_of_find_key find]``(const CompatibleKey & x); template< class CompatibleKey > const_iterator ``[link reference_set_of_find_key find]``(const CompatibleKey & x) const; template< class CompatibleKey > size_type ``[link reference_set_of_count_key count]``(const CompatibleKey & x) const; template< class CompatibleKey > iterator ``[link reference_set_of_lower_bound_key lower_bound]``(const CompatibleKey & x); template< class CompatibleKey > const_iterator ``[link reference_set_of_lower_bound_key lower_bound]``(const CompatibleKey & x) const; template< class CompatibleKey > iterator ``[link reference_set_of_upper_bound_key upper_bound]``(const CompatibleKey & x); template< class CompatibleKey > const_iterator ``[link reference_set_of_upper_bound_key upper_bound]``(const CompatibleKey & x) const; template< class CompatibleKey > std::pair<iterator,iterator> ``[link reference_set_of_equal_range_key equal_range]``(const CompatibleKey & x); template< class CompatibleKey > std::pair<const_iterator,const_iterator> ``[link reference_set_of_equal_range_key equal_range]``(const CompatibleKey & x) const; // Only in maps views // { template< class LowerBounder, class UpperBounder> std::pair<iterator,iterator> ``[link reference_set_of_range_lower_upper range]``( LowerBounder lower, UpperBounder upper); template< class LowerBounder, class UpperBounder> std::pair<const_iterator,const_iterator> ``[link reference_set_of_range_lower_upper range]``( LowerBounder lower, UpperBounder upper) const; typedef ``['-unspecified-]`` data_type; // Only in for `set_of` collection type // { template< class CompatibleKey > const data_type & ``[link reference_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_set_of_operator_bracket_key operator\[\]]``(const CompatibleKey & k); template< class CompatibleKey > data_type & ``[link reference_set_of_at_key at]``(const CompatibleKey & k); // } // Only if info_hook is used // { template< class CompatibleKey > info_type & ``[link reference_set_of_info_at_key info_at]``(const CompatibleKey & k); template< class CompatibleKey > const info_type & ``[link reference_set_of_info_at_key info_at]``(const CompatibleKey & k) const; // } // } // } }; // view comparison bool operator==(const this_type & v1, const this_type & v2 ); bool operator< (const this_type & v1, const this_type & v2 ); bool operator!=(const this_type & v1, const this_type & v2 ); bool operator> (const this_type & v1, const this_type & v2 ); bool operator>=(const this_type & v1, const this_type & v2 ); bool operator<=(const this_type & v1, const this_type & v2 ); } // namespace views } // namespace bimap } // namespace boost[/ Functions that may be implemented some day template< class Modifier> bool ``[link reference_set_of_modify_iterator_modifier modify]``(iterator position, Modifier mod); template< class CompatibleKey, class CompatibleCompare > iterator find(const CompatibleKey & x, const CompatibleCompare & comp); template< class CompatibleKey, class CompatibleCompare > const_iterator find(const CompatibleKey & x, const CompatibleCompare & comp) const; template< class CompatibleKey, class CompatibleCompare > size_type count(const CompatibleKey & x, const CompatibleCompare & comp) const; template< class CompatibleKey, class CompatibleCompare > iterator lower_bound(const CompatibleKey & x, const CompatibleCompare & comp);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -