Commit 63b1a6ba by Scott Snyder Committed by Phil Edwards

re PR libstdc++/9811 (incorrect documentation for std::map::lower_bound, etc.)

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.

From-SVN: r63396
parent bacbf399
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.
2003-02-24 Paolo Carlini <pcarlini@unitus.it> 2003-02-24 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/9825 PR libstdc++/9825
......
...@@ -496,13 +496,13 @@ namespace std ...@@ -496,13 +496,13 @@ namespace std
/** /**
* @brief Finds the beginning of a subsequence matching given key. * @brief Finds the beginning of a subsequence matching given key.
* @param x Key of (key, value) pair to be located. * @param x Key of (key, value) pair to be located.
* @return Iterator pointing to first element matching given key, or * @return Iterator pointing to first element equal to or greater
* end() if not found. * than key, or end().
* *
* This function is useful only with multimaps. It returns the first * This function returns the first element of a subsequence of elements
* element of a subsequence of elements that matches the given key. If * that matches the given key. If unsuccessful it returns an iterator
* unsuccessful it returns an iterator pointing to the first element that * pointing to the first element that has a greater value than given key
* has a greater value than given key or end() if no such element exists. * or end() if no such element exists.
*/ */
iterator iterator
lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); } lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); }
...@@ -511,12 +511,12 @@ namespace std ...@@ -511,12 +511,12 @@ namespace std
* @brief Finds the beginning of a subsequence matching given key. * @brief Finds the beginning of a subsequence matching given key.
* @param x Key of (key, value) pair to be located. * @param x Key of (key, value) pair to be located.
* @return Read-only (constant) iterator pointing to first element * @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 * This function returns the first element of a subsequence of elements
* element of a subsequence of elements that matches the given key. If * that matches the given key. If unsuccessful it returns an iterator
* unsuccessful the iterator will point to the next greatest element or, * pointing to the first element that has a greater value than given key
* if no such greater element exists, to end(). * or end() if no such element exists.
*/ */
const_iterator const_iterator
lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); }
...@@ -524,9 +524,8 @@ namespace std ...@@ -524,9 +524,8 @@ namespace std
/** /**
* @brief Finds the end of a subsequence matching given key. * @brief Finds the end of a subsequence matching given key.
* @param x Key of (key, value) pair to be located. * @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().
* This function only makes sense with multimaps.
*/ */
iterator iterator
upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); }
...@@ -534,10 +533,8 @@ namespace std ...@@ -534,10 +533,8 @@ namespace std
/** /**
* @brief Finds the end of a subsequence matching given key. * @brief Finds the end of a subsequence matching given key.
* @param x Key of (key, value) pair to be located. * @param x Key of (key, value) pair to be located.
* @return Read-only (constant) iterator pointing to last element matching * @return Read-only (constant) iterator pointing to first iterator
* given key. * greater than key, or end().
*
* This function only makes sense with multimaps.
*/ */
const_iterator const_iterator
upper_bound(const key_type& __x) const upper_bound(const key_type& __x) const
...@@ -549,14 +546,14 @@ namespace std ...@@ -549,14 +546,14 @@ namespace std
* @return Pair of iterators that possibly points to the subsequence * @return Pair of iterators that possibly points to the subsequence
* matching given key. * matching given key.
* *
* This function returns a pair of which the first * This function is equivalent to
* element possibly points to the first element matching the given key * @code
* and the second element possibly points to the last element matching the * std::make_pair(c.lower_bound(val),
* given key. If unsuccessful the first element of the returned pair will * c.upper_bound(val))
* contain an iterator pointing to the next greatest element or, if no such * @endcode
* greater element exists, to end(). * (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> pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
...@@ -568,14 +565,14 @@ namespace std ...@@ -568,14 +565,14 @@ namespace std
* @return Pair of read-only (constant) iterators that possibly points to * @return Pair of read-only (constant) iterators that possibly points to
* the subsequence matching given key. * the subsequence matching given key.
* *
* This function returns a pair of which the first * This function is equivalent to
* element possibly points to the first element matching the given key * @code
* and the second element possibly points to the last element matching the * std::make_pair(c.lower_bound(val),
* given key. If unsuccessful the first element of the returned pair will * c.upper_bound(val))
* contain an iterator pointing to the next greatest element or, if no such * @endcode
* a greater element exists, to end(). * (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> pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const equal_range(const key_type& __x) const
......
...@@ -479,8 +479,8 @@ namespace std ...@@ -479,8 +479,8 @@ namespace std
/** /**
* @brief Finds the beginning of a subsequence matching given key. * @brief Finds the beginning of a subsequence matching given key.
* @param x Key of (key, value) pair to be located. * @param x Key of (key, value) pair to be located.
* @return Iterator pointing to first element matching given key, or * @return Iterator pointing to first element equal to or greater
* end() if not found. * than key, or end().
* *
* This function returns the first element of a subsequence of elements * This function returns the first element of a subsequence of elements
* that matches the given key. If unsuccessful it returns an iterator * that matches the given key. If unsuccessful it returns an iterator
...@@ -494,7 +494,7 @@ namespace std ...@@ -494,7 +494,7 @@ namespace std
* @brief Finds the beginning of a subsequence matching given key. * @brief Finds the beginning of a subsequence matching given key.
* @param x Key of (key, value) pair to be located. * @param x Key of (key, value) pair to be located.
* @return Read-only (constant) iterator pointing to first element * @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 * This function returns the first element of a subsequence of elements
* that matches the given key. If unsuccessful the iterator will point * that matches the given key. If unsuccessful the iterator will point
...@@ -507,7 +507,8 @@ namespace std ...@@ -507,7 +507,8 @@ namespace std
/** /**
* @brief Finds the end of a subsequence matching given key. * @brief Finds the end of a subsequence matching given key.
* @param x Key of (key, value) pair to be located. * @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 iterator
upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); }
...@@ -515,8 +516,8 @@ namespace std ...@@ -515,8 +516,8 @@ namespace std
/** /**
* @brief Finds the end of a subsequence matching given key. * @brief Finds the end of a subsequence matching given key.
* @param x Key of (key, value) pair to be located. * @param x Key of (key, value) pair to be located.
* @return Read-only (constant) iterator pointing to last element matching * @return Read-only (constant) iterator pointing to first iterator
* given key. * greater than key, or end().
*/ */
const_iterator const_iterator
upper_bound(const key_type& __x) const { return _M_t.upper_bound(__x); } upper_bound(const key_type& __x) const { return _M_t.upper_bound(__x); }
...@@ -527,12 +528,12 @@ namespace std ...@@ -527,12 +528,12 @@ namespace std
* @return Pair of iterators that possibly points to the subsequence * @return Pair of iterators that possibly points to the subsequence
* matching given key. * matching given key.
* *
* This function returns a pair of which the first * This function is equivalent to
* element possibly points to the first element matching the given key * @code
* and the second element possibly points to the last element matching the * std::make_pair(c.lower_bound(val),
* given key. If unsuccessful the first element of the returned pair will * c.upper_bound(val))
* contain an iterator pointing to the next greatest element or, if no such * @endcode
* greater element exists, to end(). * (but is faster than making the calls separately).
*/ */
pair<iterator,iterator> pair<iterator,iterator>
equal_range(const key_type& __x) { return _M_t.equal_range(__x); } equal_range(const key_type& __x) { return _M_t.equal_range(__x); }
...@@ -543,12 +544,12 @@ namespace std ...@@ -543,12 +544,12 @@ namespace std
* @return Pair of read-only (constant) iterators that possibly points to * @return Pair of read-only (constant) iterators that possibly points to
* the subsequence matching given key. * the subsequence matching given key.
* *
* This function returns a pair of which the first * This function is equivalent to
* element possibly points to the first element matching the given key * @code
* and the second element possibly points to the last element matching the * std::make_pair(c.lower_bound(val),
* given key. If unsuccessful the first element of the returned pair will * c.upper_bound(val))
* contain an iterator pointing to the next greatest element or, if no such * @endcode
* a greater element exists, to end(). * (but is faster than making the calls separately).
*/ */
pair<const_iterator,const_iterator> pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } equal_range(const key_type& __x) const { return _M_t.equal_range(__x); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment