This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: [libstdc++ PATCH] libstdc++ debug mode (fourth try)
- From: Pétur Runólfsson <peturr02 at ru dot is>
- To: "Doug Gregor" <dgregor at apple dot com>,"Benjamin Kosnik" <bkoz at redhat dot com>
- Cc: <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 7 Aug 2003 08:58:34 -0000
- Subject: RE: [libstdc++ PATCH] libstdc++ debug mode (fourth try)
Hi,
The debug mode seems overly strict about binary_search:
Index: docs/html/debug.html
[...]
! <li><em>Algorithm preconditions</em>: Algorithms attempt to
! validate their input parameters to detect errors as early as
! possible. For instance, the <code>binary_search</code> algorithm
! requires that its iterator parameters <code>first</code>
! and <code>last</code> form a valid iterator range, and that the
! sequence [<code>first</code>, <code>last</code>) is sorted
! according to the same predicate that was passed
! to <code>binary_search</code>; the libstdc++ debug mode will
! detect an error if the sequence is not sorted or was sorted by a
! different predicate.</li>
binary_search does not require the sequence to be sorted:
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#270
Regards,
Petur