[libcxx-commits] [PATCH] D126993: [libc++] Remove a bunch of conditionals on _LIBCPP_DEBUG_LEVEL

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 3 12:32:47 PDT 2022


ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Instead of providing two different constructors for iterators that
support the debug mode, provide a single constructor but leave the
container parameter unused when the debug mode is not enabled.

This allows simplifying all the call sites to unconditionally pass
the container, which removes a bunch of duplication in the container's
implementation.

Note that this patch does add some complexity to std::span, however
that is only because std::span has the ability to use raw pointers
as iterators instead of __wrap_iter. In retrospect, I believe it was
a mistake to provide that capability, and so it will be removed in a
future patch, along with the complexity added by this patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126993

Files:
  libcxx/include/__hash_table
  libcxx/include/__iterator/wrap_iter.h
  libcxx/include/list
  libcxx/include/span
  libcxx/include/string
  libcxx/include/vector

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126993.434108.patch
Type: text/x-patch
Size: 27503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220603/05bf14ff/attachment-0001.bin>


More information about the libcxx-commits mailing list