[libcxx-commits] [PATCH] D102121: [libcxx][ranges] adds _`non-propagating-cache`_

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 8 19:01:01 PDT 2021


cjdb added inline comments.


================
Comment at: libcxx/include/__ranges/non_propagating_cache.h:60-66
+    template<indirectly_readable _Ip>
+    requires std::constructible_from<_Tp, iter_reference_t<_Ip> >
+    constexpr _Tp& __emplace_deref(const _Ip& __i) {
+      optional<_Tp>::reset();
+      optional<_Tp>::emplace(*__i);
+      return **this;
+    }
----------------
@tcanens I've deliberately not put a cache wrapper here yet, because I'm not sure if the wrapper needs to go inside `__emplace_deref` or if it goes in `optional<__cache_wrapper<_Tp>>` (and here), or somewhere else entirely.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102121



More information about the libcxx-commits mailing list