[libc++] [LIBCXX-DEBUG-FIXME] Our `__debug_less` breaks some complexity guarantees.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 20 Apr 2021 22:21:59 +0000 (18:21 -0400)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Wed, 5 May 2021 20:21:09 +0000 (16:21 -0400)
commit165ad89947e8ef6c08c80eb067d85b4fa9074904
treee0591d9651f7d8dcb09a89e84b191ae2338f5831
parent12dd9cdf1a8267e0c5db4f191f2598648de02619
[libc++] [LIBCXX-DEBUG-FIXME] Our `__debug_less` breaks some complexity guarantees.

`__debug_less` ends up running the comparator up-to-twice per comparison,
because whenever `(x < y)` it goes on to verify that `!(y < x)`.
This breaks the strict "Complexity" guarantees of algorithms like
`inplace_merge`, which we test in the test suite. So, just skip the
complexity assertions in debug mode.

Differential Revision: https://reviews.llvm.org/D101677
libcxx/docs/DesignDocs/DebugMode.rst
libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp