`__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.
Details
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rG165ad89947e8: [libc++] [LIBCXX-DEBUG-FIXME] Our `__debug_less` breaks some complexity…
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
LGTM, but please add a note in libcxx/docs/DesignDocs/DebugMode.rst that we don't necessarily respect complexity guarantees under the debug mode, which isn't obvious (but it makes sense when you think about it).