[libcxx-commits] [PATCH] D116486: [libc++][NFC] Use _LIBCPP_DEBUG_ASSERT in <__hash_table>

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 2 08:45:49 PST 2022


philnik added inline comments.


================
Comment at: libcxx/include/__hash_table:2488
+                         "unordered container erase(iterator) called with a non-dereferenceable iterator");
 #if _LIBCPP_DEBUG_LEVEL == 2
     iterator __r(__np, this);
----------------
Mordante wrote:
> In this case I have a slight preference to keep the original code, since it doesn't remove the `#if`. But I won't object against the change.
I found it much easier to read the code because you have the
```
#if _LIBCPP_DEBUG_LEVEL == 2
  do_something();
#else
  do_essentially_the_same_thing();
#endif
```
all over this file, but almost never any assertions in the if block. Now you never have assertions in the same #if block.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116486/new/

https://reviews.llvm.org/D116486



More information about the libcxx-commits mailing list