[libcxx-commits] [PATCH] D96742: [libcxx] adds concept `std::assignable_from`
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 4 15:39:45 PST 2021
ldionne added inline comments.
================
Comment at: libcxx/test/std/concepts/lang/assignable.compile.pass.cpp:138
+
+ constexpr auto Result = std::assignable_from<T1&, const T2&>;
+ static_assert(std::assignable_from<T1&, T2&> == Result);
----------------
Quuxplusone wrote:
> This `auto` means `bool`, right? I'd like to see `bool` here if that's the intention.
> (ditto throughout)
>
Nitpicky but +1, I'm not a huge fan of using `auto` for simple types.
================
Comment at: libcxx/test/std/concepts/lang/assignable.compile.pass.cpp:547
+static_assert(!CheckAssignableFromLvaluesAndRvalues<std::vector<int>,
+ std::vector<const int> >());
+static_assert(!CheckAssignableFromLvaluesAndRvalues<
----------------
Quuxplusone wrote:
> Here and line 535: is it actually cromulent to create a container with a const (key/element) type? If this is sort of "library IFNDR" then we shouldn't be doing it in tests. But I don't think anything of value would be lost by removing these two lines, anyway, right?
Hmm, I had missed that indeed but `std::vector<T const>` isn't allowed because `T const` isn't movable. I think we should remove it. @cjdb did you do this in other tests too? If so, we should fix them too.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96742/new/
https://reviews.llvm.org/D96742
More information about the libcxx-commits
mailing list