[libstdc++ PATCH] libstdc++ debug mode (fourth try)

Pétur Runólfsson peturr02@ru.is
Thu Aug 7 08:58:00 GMT 2003


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



More information about the Libstdc++ mailing list