libstdc++/8195: n-th algorithm (STL) doesn`t work properly
Fri Oct 11 04:16:00 GMT 2002

>Number:         8195
>Category:       libstdc++
>Synopsis:       n-th algorithm (STL) doesn`t work properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 11 04:16:01 PDT 2002
>Originator: (Eugeny Belov)
>Release:        g++ v3.2
Red Hat Linux release 8.0
The simple testcase using nth_element() doesn`t work properly. Compiled by g++ (v.3.2, 3.1, 2.96) it gives the "4 4 5 6 6 6 9 12 8 10", but expected output is "4 4 5 6 6 6 8 9 10 12" (sorted sequence). See the testcase.
Compile the testcase by g++ and run it, compare output. The correct result is the sorted integers sequence.

Content-Type: application/octet-stream; name="nth-elem.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="nth-elem.cpp"


More information about the Gcc-bugs mailing list