[libcxx-commits] [PATCH] D107932: [libc++] Do not require movability in __non_propagating_cache::__emplace_deref

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 17 08:32:22 PDT 2021


ldionne accepted this revision.
ldionne marked an inline comment as done.
ldionne added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/include/__ranges/non_propagating_cache.h:103
+    constexpr _Tp& __emplace(_Args&& ...__args) {
+      return __value_.emplace(__forward_tag{}, _VSTD::forward<_Args>(__args)...).__t_;
     }
----------------
Quuxplusone wrote:
> FWIW, this could be
> ```
> return __value_.emplace(__from_tag{}, [&]() { return _Tp(_VSTD::forward<_Args>(__args)...); }).__t_;
> ```
> and then eliminate `__forward_tag`. No strong preference.
Will keep as-is, I like to avoid creating a potentially large number of captures in the lambda here (even if those are by ref).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107932



More information about the libcxx-commits mailing list