[libcxx-commits] [PATCH] D128281: [libc++] fix views::all hard error on lvalue move only views instead of SFINAE

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 21 11:21:49 PDT 2022


EricWF added inline comments.


================
Comment at: libcxx/include/__ranges/all.h:42
       noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t))))
+      -> decltype(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)))
     {
----------------
var-const wrote:
> I wonder if we have any other cases where we don't write the return type 3 times and consequently don't get SFINAE.
Is this a case of "not getting SFINAE" or "auto" return types not deducing to reference types? Does this work if we use `decltype(auto)` instead?

Also this changes the return type from being by-value to being by-reference, which is the intended change I assume?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128281



More information about the libcxx-commits mailing list