This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]