[libcxx-commits] [PATCH] D124477: [libc++] Add a few _LIBCPP_ASSERTs in __tree
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 4 11:15:02 PDT 2022
ldionne added inline comments.
================
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.
----------------
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.
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