[libcxx-commits] [PATCH] D110370: [libc++][NFCI] Simplify std::ranges::subrange

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 23 15:12:15 PDT 2021


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

Instead of using a base class to store the members and the optional
size, use [[no_unique_address]] to achieve the same thing without
needing a base class.

Also, as a fly-by:

- Change subrange from struct to class (per the standard)
- Improve the diagnostic for when one doesn't provide a size to the ctor of a sized subrange
- Replace this->member by just member since it's not in a dependent base anymore

This change would be an ABI break due to [[no_unique_address]], but we
haven't shipped ranges anywhere yet.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110370

Files:
  libcxx/include/__ranges/subrange.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110370.374681.patch
Type: text/x-patch
Size: 7851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210923/00cfe3ee/attachment-0001.bin>


More information about the libcxx-commits mailing list