[libcxx-commits] [PATCH] D102028: [libcxx][ranges] Implement views::all.

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 11 16:42:18 PDT 2021


cjdb added inline comments.


================
Comment at: libcxx/include/__ranges/views_all.h:52
+    constexpr auto operator()(_Tp&& __t) const {
+      return ranges::subrange{_VSTD::forward<_Tp>(__t)};
+    }
----------------
Quuxplusone wrote:
> This may be a complete red herring: I vaguely recall an LWG issue and/or paper that pointed out that a whole bunch of brace-initializations in the Standard needed to be parens-initializations, and/or needed to stop using CTAD, because they would do the wrong thing under CTAD. All I can actually find by googling/gmail-searching, though, is @brevzin's https://cplusplus.github.io/LWG/issue3474 . Does anyone know whether (1) such a blanket issue exists, (2) should exist, and/or (3) applies here? @tcanens, thoughts?
> 
> (This code looks correct-w.r.t.-the-standard-as-written, modulo `noexcept`.)
Yes, I think this is informally called Tim-initialisation-fiasco in LWG since he pointed it out. I distinctly remember //something// relevant in Cologne or Belfast, but I thought it was all resolved there. I've gotten into the habit of putting `// braces intentional` on anything that genuinely needs brace-init in template code.


================
Comment at: libcxx/include/__ranges/views_all.h:38
+    constexpr auto operator()(_Tp&& __t) const {
+      return _VSTD::move(__t);
+    }
----------------
Quuxplusone wrote:
> tcanens wrote:
> > This should be forward.
> Here and throughout, [my understanding is that] "expression-equivalent" requires an appropriate `noexcept` clause. (Please check your other PRs as well.)
> Here and throughout, [my understanding is that] "expression-equivalent" requires an appropriate `noexcept` clause. (Please check your other PRs as well.)

Yep.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102028



More information about the libcxx-commits mailing list