[libcxx-commits] [PATCH] D102121: [libcxx][ranges] adds _`non-propagating-cache`_
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jul 20 13:01:07 PDT 2021
Mordante added inline comments.
================
Comment at: libcxx/include/__ranges/non_propagating_cache.h:42
+ // may refer to internal details of the source view.
+ template<class _Tp>
+ class __non_propagating_cache {
----------------
Quuxplusone wrote:
> Mordante wrote:
> > http://eel.is/c++draft/range.nonprop.cache#1.1 `non-propagating-cache<T> constrains its type parameter T with is_object_v<T>.`
> This is undetectable, and therefore it's cheaper (in terms of compile time and source code simplicity) not to bother with it.
Ok. (It just makes me wonder why it's specified in the Standard.)
================
Comment at: libcxx/include/__ranges/non_propagating_cache.h:87
+ constexpr void __set(_Tp&& __value) { __value_.emplace(_VSTD::move(__value)); }
+ };
+
----------------
Quuxplusone wrote:
> Mordante wrote:
> > I miss http://eel.is/c++draft/range.nonprop.cache#1.6
> > ```
> > non-propagating-cache<T> has an additional member function template specified as follows:
> >
> > template<class I>
> > constexpr T& emplace-deref(const I& i); // exposition only
> >
> > ```
> > Is that intentionally?
> Exposition-only members are undetectable, and anyway it looks like //`emplace-deref`// is equivalent to `this->emplace(*i)`.
> See tcanens' comment https://reviews.llvm.org/D102121#inline-965635
Then it seems it's indeed intentionally.
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