[libcxx-commits] [PATCH] D60368: Add bind_front function (P0356R5)
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Sep 20 14:27:06 PDT 2020
zoecarver added inline comments.
================
Comment at: libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.pass.cpp:234
+
+ static_assert(constexpr_test());
+
----------------
ldionne wrote:
> Could you instead write all the tests in a constexpr function, and call it once from `main()`, and once inside a `static_assert`? This way, we would get the full coverage for both non-constexpr and constexpr code. Like I've done in the tests of https://reviews.llvm.org/D68364.
Good idea. Got it working but had to update `invoke` to be constexpr after C++17.
================
Comment at: libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.pass.cpp:197
+ {
+ static_assert(!std::is_invocable<decltype(takes_not_move_constructable),
+ not_move_construcable>::value);
----------------
ldionne wrote:
> zoecarver wrote:
> > Any ideas for types that are move constructible and aren't "self constructible" (i.e. `!is_constructible_v<decay_t<T>, T>`)?
> You mean a type that satisfies: `is_constructible_v<decay_t<T>, T&&> && !is_constructible_v<decay_t<T>, T>`? No, I can't think of anything.
OK. Do we even need the second check, then? It seems odd the paper would have it if it's redundant. But maybe it was just an oversight.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60368/new/
https://reviews.llvm.org/D60368
More information about the libcxx-commits
mailing list