[libcxx-commits] [PATCH] D97911: [libcxx] adds concept std::semiregular

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 10 14:49:23 PST 2021

cjdb added inline comments.

Comment at: libcxx/test/std/concepts/object/copyable.h:39
 struct const_copy_assignment {
+  const_copy_assignment();
Quuxplusone wrote:
> I'm confused by this change. Was `const_copy_assignment` already used in the tests for `std::copyable`? Were those tests intended to check that it was `std::copyable` despite being not-default-initializable? By making it default-initializable (and thus `std::semiregular`), are you nerfing the existing `std::copyable` tests?
The name of the type describes what's going on. This type would have been automatically default-initalisable if I hadn't needed to supply the other constructors to get back copyability (and since the default constructor wasn't necessary at the time, I forgot to add it back in). This type never //intended// to exclude the default constructor, it just did by accident.

I don't consider it a nerf, because concepts aren't exclusive, and being `default_initializable` doesn't have any relation to `copyable`. //However// since D97443 hasn't landed, I've moved this change over there, along with others (e.g. line 58).

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list