[libcxx-commits] [PATCH] D124477: [libc++] Add a few _LIBCPP_ASSERTs in __tree
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 4 11:20:33 PDT 2022
philnik accepted this revision as: philnik.
philnik added a comment.
LGTM assuming CI passes.
================
Comment at: libcxx/include/__tree:355
// Precondition: __root != nullptr && __z != nullptr.
// __tree_invariant(__root) == true.
// __z == __root or == a direct or indirect child of __root.
----------------
ldionne wrote:
> philnik wrote:
> > Could you also add that precondition?
> I'll do that, but I'll add it as a `_LIBCPP_DEBUG_ASSERT`, since checking that invariant requires recursively visiting the whole tree AFAICT. `_LIBCPP_ASSERT` assertions should be cheap and should not impact complexity.
Sounds good.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124477/new/
https://reviews.llvm.org/D124477
More information about the libcxx-commits
mailing list