|
1620 | 1620 | \tcode{m} denotes an allocator of a type convertible to \tcode{A},
|
1621 | 1621 | and \tcode{nh} denotes a non-const rvalue of type \tcode{X::node_type}.
|
1622 | 1622 |
|
| 1623 | +% Local command to index names as members of all ordered containers. |
| 1624 | +\newcommand{\indexordmem}[1]{% |
| 1625 | +\indexlibrary{\idxcode{#1}!ordered associative containers}% |
| 1626 | +\indexlibrary{\idxcode{set}!\idxcode{#1}}% |
| 1627 | +\indexlibrary{\idxcode{map}!\idxcode{#1}}% |
| 1628 | +\indexlibrary{\idxcode{multiset}!\idxcode{#1}}% |
| 1629 | +\indexlibrary{\idxcode{multimap}!\idxcode{#1}}% |
| 1630 | +} |
| 1631 | + |
1623 | 1632 | \begin{libreqtab4b}
|
1624 | 1633 | {Associative container requirements (in addition to container)}
|
1625 | 1634 | {tab:containers.associative.requirements}
|
|
1948 | 1957 | \tcode{!c(r, ke) \&\& !c(ke, r)} &
|
1949 | 1958 | $\log (\tcode{a_tran.size()}) + \tcode{a_tran.count(ke)}$ \\ \rowsep
|
1950 | 1959 |
|
| 1960 | +\indexordmem{contains}% |
| 1961 | +\tcode{b.}\br |
| 1962 | + \tcode{contains(k)} & |
| 1963 | + \tcode{bool} & |
| 1964 | + equivalent to \tcode{b.find(k) != b.end()} & |
| 1965 | + logarithmic \\ \rowsep |
| 1966 | + |
| 1967 | +\tcode{a_tran.}\br |
| 1968 | + \tcode{con\-tains(ke)} & |
| 1969 | + \tcode{bool} & |
| 1970 | + equivalent to \tcode{a_tran.find(ke) != a_tran.end()} & |
| 1971 | + logarithmic \\ \rowsep |
| 1972 | + |
1951 | 1973 | \tcode{b.lower_bound(k)} &
|
1952 | 1974 | \tcode{iterator}; \tcode{const_iterator} for constant \tcode{b}. &
|
1953 | 1975 | returns an iterator pointing to the first element with
|
|
2044 | 2066 | its constructor.
|
2045 | 2067 |
|
2046 | 2068 | \pnum
|
2047 |
| -The member function templates \tcode{find}, \tcode{count}, \tcode{lower_bound}, |
2048 |
| -\tcode{upper_bound}, and \tcode{equal_range} shall not participate in overload |
2049 |
| -resolution unless the \grammarterm{qualified-id} \tcode{Compare::is_transparent} is valid |
| 2069 | +The member function templates |
| 2070 | +\tcode{find}, \tcode{count}, \tcode{contains}, |
| 2071 | +\tcode{lower_bound}, \tcode{upper_bound}, and \tcode{equal_range} |
| 2072 | +shall not participate in overload resolution unless |
| 2073 | +the \grammarterm{qualified-id} \tcode{Compare::is_transparent} is valid |
2050 | 2074 | and denotes a type\iref{temp.deduct}.
|
2051 | 2075 |
|
2052 | 2076 | \pnum
|
|
2672 | 2696 | & Average case \bigoh{\tcode{b.count(k)}}, worst case \bigoh{\tcode{b.size()}}.
|
2673 | 2697 | \\ \rowsep
|
2674 | 2698 | %
|
| 2699 | +\indexunordmem{contains}% |
| 2700 | +\tcode{b.contains(k)} |
| 2701 | +& \tcode{bool} |
| 2702 | +& Equivalent to \tcode{b.find(k) != b.end()}% |
| 2703 | +& Average case \bigoh{1}, worst case \bigoh{\tcode{b.size()}}. |
| 2704 | +\\ \rowsep |
| 2705 | +% |
2675 | 2706 | \indexunordmem{equal_range}%
|
2676 | 2707 | \tcode{b.equal_range(k)}
|
2677 | 2708 | & \tcode{pair<iterator, iterator>}; \br
|
|
6104 | 6135 | size_type count(const key_type& x) const;
|
6105 | 6136 | template<class K> size_type count(const K& x) const;
|
6106 | 6137 |
|
| 6138 | + bool contains(const key_type& x) const; |
| 6139 | + template<class K> bool contains(const K& x) const; |
| 6140 | + |
6107 | 6141 | iterator lower_bound(const key_type& x);
|
6108 | 6142 | const_iterator lower_bound(const key_type& x) const;
|
6109 | 6143 | template<class K> iterator lower_bound(const K& x);
|
|
6596 | 6630 | size_type count(const key_type& x) const;
|
6597 | 6631 | template<class K> size_type count(const K& x) const;
|
6598 | 6632 |
|
| 6633 | + bool contains(const key_type& x) const; |
| 6634 | + template<class K> bool contains(const K& x) const; |
| 6635 | + |
6599 | 6636 | iterator lower_bound(const key_type& x);
|
6600 | 6637 | const_iterator lower_bound(const key_type& x) const;
|
6601 | 6638 | template<class K> iterator lower_bound(const K& x);
|
|
6875 | 6912 | size_type count(const key_type& x) const;
|
6876 | 6913 | template<class K> size_type count(const K& x) const;
|
6877 | 6914 |
|
| 6915 | + bool contains(const key_type& x) const; |
| 6916 | + template<class K> bool contains(const K& x) const; |
| 6917 | + |
6878 | 6918 | iterator lower_bound(const key_type& x);
|
6879 | 6919 | const_iterator lower_bound(const key_type& x) const;
|
6880 | 6920 | template<class K> iterator lower_bound(const K& x);
|
|
7126 | 7166 | size_type count(const key_type& x) const;
|
7127 | 7167 | template<class K> size_type count(const K& x) const;
|
7128 | 7168 |
|
| 7169 | + bool contains(const key_type& x) const; |
| 7170 | + template<class K> bool contains(const K& x) const; |
| 7171 | + |
7129 | 7172 | iterator lower_bound(const key_type& x);
|
7130 | 7173 | const_iterator lower_bound(const key_type& x) const;
|
7131 | 7174 | template<class K> iterator lower_bound(const K& x);
|
|
7536 | 7579 | iterator find(const key_type& k);
|
7537 | 7580 | const_iterator find(const key_type& k) const;
|
7538 | 7581 | size_type count(const key_type& k) const;
|
| 7582 | + bool contains(const key_type& k) const; |
7539 | 7583 | pair<iterator, iterator> equal_range(const key_type& k);
|
7540 | 7584 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
|
7541 | 7585 |
|
|
8064 | 8108 | iterator find(const key_type& k);
|
8065 | 8109 | const_iterator find(const key_type& k) const;
|
8066 | 8110 | size_type count(const key_type& k) const;
|
| 8111 | + bool contains(const key_type& k) const; |
8067 | 8112 | pair<iterator, iterator> equal_range(const key_type& k);
|
8068 | 8113 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
|
8069 | 8114 |
|
|
8390 | 8435 | iterator find(const key_type& k);
|
8391 | 8436 | const_iterator find(const key_type& k) const;
|
8392 | 8437 | size_type count(const key_type& k) const;
|
| 8438 | + bool contains(const key_type& k) const; |
8393 | 8439 | pair<iterator, iterator> equal_range(const key_type& k);
|
8394 | 8440 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
|
8395 | 8441 |
|
|
8678 | 8724 | iterator find(const key_type& k);
|
8679 | 8725 | const_iterator find(const key_type& k) const;
|
8680 | 8726 | size_type count(const key_type& k) const;
|
| 8727 | + bool contains(const key_type& k) const; |
8681 | 8728 | pair<iterator, iterator> equal_range(const key_type& k);
|
8682 | 8729 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
|
8683 | 8730 |
|
|
0 commit comments