Author: sebor Date: Tue Apr 7 22:46:58 2009 New Revision: 763021 URL: http://svn.apache.org/viewvc?rev=763021&view=rev Log: 2009-04-07 Martin Sebor STDCXX-1033 * doc/stdlibug/14-3.html: Corrected a typo. Modified: stdcxx/trunk/doc/stdlibug/14-3.html (contents, props changed) Modified: stdcxx/trunk/doc/stdlibug/14-3.html URL: http://svn.apache.org/viewvc/stdcxx/trunk/doc/stdlibug/14-3.html?rev=763021&r1=763020&r2=763021&view=diff ============================================================================== --- stdcxx/trunk/doc/stdlibug/14-3.html (original) +++ stdcxx/trunk/doc/stdlibug/14-3.html Tue Apr 7 22:46:58 2009 @@ -44,8 +44,8 @@ [, Compare ] ); } -

Following the call on std::nth_element(), the nth largest value is copied into the position denoted by the middle iterator. The region between the first iterator and the middle iterator will have values no larger than the nth element, while the region between the middle iterator and the end will hold values no smaller than the nth element.

-

The example program illustrates finding the fifth largest value in a vector of random numbers.

+

Following the call on std::nth_element(), the nth smallest value (as determined by the optional Compare predicate, or by std::less, when none is specified) is copied into the position denoted by the middle iterator. The region between the first iterator and the middle iterator will have values no larger than the nth element, while the region between the middle iterator and the end will hold values no smaller than the nth element.

+

The example program illustrates finding the fifth smallest value in a vector of random numbers.

@@ -57,11 +57,11 @@
std::vector<int> aVec(10);
std::generate(aVec.begin(), aVec.end(), randomValue);

-  // now find the 5th largest
+  // now find the 5th smallest value
std::vector<int>::iterator nth = aVec.begin() + 4;
std::nth_element(aVec.begin(), nth, aVec.end());

-  std::cout << "fifth largest is " << *nth << std::endl;
+  std::cout << "fifth smallest is " << *nth << std::endl;
}

Propchange: stdcxx/trunk/doc/stdlibug/14-3.html ------------------------------------------------------------------------------ svn:mergeinfo = /stdcxx/branches/4.2.x/doc/stdlibug/14-3.html:763018