[libcxx-commits] [PATCH] D91292: [libc++] [P0935] [C++20] Eradicating unnecessarily explicit default constructors from the standard library.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 1 15:47:15 PST 2020

ldionne added a comment.

In D91292#2424853 <https://reviews.llvm.org/D91292#2424853>, @curdeius wrote:

> @ldionne, 've discussed it with @zoecarver, and we decided that I'll take it over. It might take some time as there are many things to change (and test), but I'll appreciate your feedback.
> My doubts:
> - is using `make_implicit` really necessary or just `test_convertible` is enough? Using `make_implicit` tests as well that the default parameter is the correct one. It's not always possible (as in `random_device` for instance).

I think we should test the value of the default argument when we can, as you did.

> - name and location of `make_implicit`?

What you have looks OK to me.

> - I added as well test for ctors being explicit, and that was not tested before.

Thank you!

In D91292#2425285 <https://reviews.llvm.org/D91292#2425285>, @curdeius wrote:

> One more question, lots of stuff in <random> tests are also run in c++03. Is it expected? Should I add guards to my additions (`#if TEST_STD_VER >= 11`)?

We support `<random>` in C++03. It's one of those great things :-).

Comment at: libcxx/test/support/make_implicit.h:25
+T make_implicit(Args&&... args) {
+  return {std::forward<Args>(args)...};
C++11 is required only because you're using a brace initializer, right? Clang supports variadics and rvalue references even in C++03 mode, so I'm just checking.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list