[libcxx-commits] [PATCH] D118963: [libc++] No longer support ranges::begin(x) when x is an array of incomplete type.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 3 18:49:10 PST 2022


Quuxplusone added inline comments.


================
Comment at: libcxx/include/__ranges/access.h:73
+      return __t + 0;
     }
 
----------------
The use of `_Tp (&__t)[]` here instead of `is_array_v` is both for symmetry with `ranges::end`, //and// because we need to make sure that we never try to evaluate `*__t` before we're absolutely sure that `__t` is an array type (because if it's a class type, that'll do ADL and we don't want ADL).
`__t + 0` could be just `__t` AFAIK, but the standard says `__t + 0` and I can't see any way for that to hurt anything.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118963



More information about the libcxx-commits mailing list