[libcxx-commits] [PATCH] D101277: [libcxx][iterator] adds `indirectly_[regular_]unary_invocable` and `projected`
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 26 09:09:47 PDT 2021
zoecarver added inline comments.
================
Comment at: libcxx/test/std/iterators/iterator.requirements/indirectcallable/indirectcallable.indirectinvocable/indirect_result_t.compile.pass.cpp:26
+static_assert(std::same_as<std::indirect_result_t<long S::*, S*>, long&>);
+static_assert(std::same_as<std::indirect_result_t<S && (S::*)(), S*>, S&&>);
+static_assert(std::same_as<std::indirect_result_t<int S::* (S::*)(int) const, S*, int*>, int S::*>);
----------------
Mordante wrote:
> I would like to see some tests returning cv-qualified references.
> Can you test some other invokable objects?
> Can you test some other invokable objects?
There are some other interesting types in `is_invocable.pass.cpp`. Maybe one where we pick the correct overload, where there's a variadic (or even a template) involved, an explicit operator, a deleted overload, etc.
Would it make any sense to have a test where the result is void?
Also, maybe a few more negatives. Right now the only way we check that `Is` is `indirectly_readable` is that it's not `int`. That //could// be implemented `typename std::iter_reference_t` only. How about a type that is dereferenceable, but not `iter_move`able.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101277/new/
https://reviews.llvm.org/D101277
More information about the libcxx-commits
mailing list