diff options
author | pme <pme@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-25 06:27:10 +0000 |
---|---|---|
committer | pme <pme@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-25 06:27:10 +0000 |
commit | d050c56ce42a792407337ff4bb173014fc49e022 (patch) | |
tree | ac8e19e33ecfffa4314a290b4b61705a5e40c651 /libstdc++-v3/include | |
parent | a6740756855f9a43625fd56b81162fb144d1cbb2 (diff) | |
download | ppe42-gcc-d050c56ce42a792407337ff4bb173014fc49e022.tar.gz ppe42-gcc-d050c56ce42a792407337ff4bb173014fc49e022.zip |
2003-02-25 Scott Snyder <snyder@fnal.gov>
PR libstdc++/9811
* include/bits/stl_map.h (lower_bound, upper_bound, equal_range):
Correct documentation.
* include/bits/stl_multimap.h (lower_bound, upper_bound,
equal_range): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63396 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/stl_map.h | 61 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_multimap.h | 37 |
2 files changed, 48 insertions, 50 deletions
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index adb2e9a9d9b..853ef3ec032 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -496,13 +496,13 @@ namespace std /** * @brief Finds the beginning of a subsequence matching given key. * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to first element matching given key, or - * end() if not found. + * @return Iterator pointing to first element equal to or greater + * than key, or end(). * - * This function is useful only with multimaps. It returns the first - * element of a subsequence of elements that matches the given key. If - * unsuccessful it returns an iterator pointing to the first element that - * has a greater value than given key or end() if no such element exists. + * This function returns the first element of a subsequence of elements + * that matches the given key. If unsuccessful it returns an iterator + * pointing to the first element that has a greater value than given key + * or end() if no such element exists. */ iterator lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); } @@ -511,12 +511,12 @@ namespace std * @brief Finds the beginning of a subsequence matching given key. * @param x Key of (key, value) pair to be located. * @return Read-only (constant) iterator pointing to first element - * matching given key, or end() if not found. + * equal to or greater than key, or end(). * - * This function is useful only with multimaps. It returns the first - * element of a subsequence of elements that matches the given key. If - * unsuccessful the iterator will point to the next greatest element or, - * if no such greater element exists, to end(). + * This function returns the first element of a subsequence of elements + * that matches the given key. If unsuccessful it returns an iterator + * pointing to the first element that has a greater value than given key + * or end() if no such element exists. */ const_iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } @@ -524,9 +524,8 @@ namespace std /** * @brief Finds the end of a subsequence matching given key. * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to last element matching given key. - * - * This function only makes sense with multimaps. + * @return Iterator pointing to the first element + * greater than key, or end(). */ iterator upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } @@ -534,10 +533,8 @@ namespace std /** * @brief Finds the end of a subsequence matching given key. * @param x Key of (key, value) pair to be located. - * @return Read-only (constant) iterator pointing to last element matching - * given key. - * - * This function only makes sense with multimaps. + * @return Read-only (constant) iterator pointing to first iterator + * greater than key, or end(). */ const_iterator upper_bound(const key_type& __x) const @@ -549,14 +546,14 @@ namespace std * @return Pair of iterators that possibly points to the subsequence * matching given key. * - * This function returns a pair of which the first - * element possibly points to the first element matching the given key - * and the second element possibly points to the last element matching the - * given key. If unsuccessful the first element of the returned pair will - * contain an iterator pointing to the next greatest element or, if no such - * greater element exists, to end(). + * This function is equivalent to + * @code + * std::make_pair(c.lower_bound(val), + * c.upper_bound(val)) + * @endcode + * (but is faster than making the calls separately). * - * This function only makes sense for multimaps. + * This function probably only makes sense for multimaps. */ pair<iterator,iterator> equal_range(const key_type& __x) @@ -568,14 +565,14 @@ namespace std * @return Pair of read-only (constant) iterators that possibly points to * the subsequence matching given key. * - * This function returns a pair of which the first - * element possibly points to the first element matching the given key - * and the second element possibly points to the last element matching the - * given key. If unsuccessful the first element of the returned pair will - * contain an iterator pointing to the next greatest element or, if no such - * a greater element exists, to end(). + * This function is equivalent to + * @code + * std::make_pair(c.lower_bound(val), + * c.upper_bound(val)) + * @endcode + * (but is faster than making the calls separately). * - * This function only makes sense for multimaps. + * This function probably only makes sense for multimaps. */ pair<const_iterator,const_iterator> equal_range(const key_type& __x) const diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index 7b18d46598f..f35e3a21239 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -479,8 +479,8 @@ namespace std /** * @brief Finds the beginning of a subsequence matching given key. * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to first element matching given key, or - * end() if not found. + * @return Iterator pointing to first element equal to or greater + * than key, or end(). * * This function returns the first element of a subsequence of elements * that matches the given key. If unsuccessful it returns an iterator @@ -494,7 +494,7 @@ namespace std * @brief Finds the beginning of a subsequence matching given key. * @param x Key of (key, value) pair to be located. * @return Read-only (constant) iterator pointing to first element - * matching given key, or end() if not found. + * equal to or greater than key, or end(). * * This function returns the first element of a subsequence of elements * that matches the given key. If unsuccessful the iterator will point @@ -507,7 +507,8 @@ namespace std /** * @brief Finds the end of a subsequence matching given key. * @param x Key of (key, value) pair to be located. - * @return Iterator pointing to last element matching given key. + * @return Iterator pointing to the first element + * greater than key, or end(). */ iterator upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } @@ -515,8 +516,8 @@ namespace std /** * @brief Finds the end of a subsequence matching given key. * @param x Key of (key, value) pair to be located. - * @return Read-only (constant) iterator pointing to last element matching - * given key. + * @return Read-only (constant) iterator pointing to first iterator + * greater than key, or end(). */ const_iterator upper_bound(const key_type& __x) const { return _M_t.upper_bound(__x); } @@ -527,12 +528,12 @@ namespace std * @return Pair of iterators that possibly points to the subsequence * matching given key. * - * This function returns a pair of which the first - * element possibly points to the first element matching the given key - * and the second element possibly points to the last element matching the - * given key. If unsuccessful the first element of the returned pair will - * contain an iterator pointing to the next greatest element or, if no such - * greater element exists, to end(). + * This function is equivalent to + * @code + * std::make_pair(c.lower_bound(val), + * c.upper_bound(val)) + * @endcode + * (but is faster than making the calls separately). */ pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } @@ -543,12 +544,12 @@ namespace std * @return Pair of read-only (constant) iterators that possibly points to * the subsequence matching given key. * - * This function returns a pair of which the first - * element possibly points to the first element matching the given key - * and the second element possibly points to the last element matching the - * given key. If unsuccessful the first element of the returned pair will - * contain an iterator pointing to the next greatest element or, if no such - * a greater element exists, to end(). + * This function is equivalent to + * @code + * std::make_pair(c.lower_bound(val), + * c.upper_bound(val)) + * @endcode + * (but is faster than making the calls separately). */ pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } |