This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/8195: n-th algorithm (STL) doesn`t work properly
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: johnb at stl dot sarov dot ru, <gcc-bugs at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>
- Date: Fri, 11 Oct 2002 09:42:48 -0500 (CDT)
- Subject: Re: libstdc++/8195: n-th algorithm (STL) doesn`t work properly
This is not a bug, so may be closed.
nth_element does not sort the _entire_ array, it only makes sure that the
elements before the nth-pointer are smaller, and the ones behind that are
larger than the element pointed to by nth (the second argument). It makes
no guarantees that each of these two parts of the entire range is sorted
itself.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth