[libcxx-commits] [PATCH] D116621: [libc++][P2321R2] Add const overloads to tuple swap, construction and assignment

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 13 14:21:43 PDT 2022


philnik added inline comments.


================
Comment at: libcxx/include/tuple:814
 
     // tuple(tuple<U...>&&) constructors (including allocator_arg_t variants)
     template <class ..._Up>
----------------
Quuxplusone wrote:
> You're going to need the same `bool _Const` technique here. Please add a regression test that can detect the problem (e.g. via a type `A` where `A&&` is convertible to `B` but `B(const A&&)=delete`, and vice versa).
I wasn't able to reproduce it.


================
Comment at: libcxx/include/type_traits:506-509
+  template <class...>
+  using _FirstImpl = __nat;
+  template <class...>
+  using _SecondImpl = __nat;
----------------
Quuxplusone wrote:
> Uh...? This completely changes the meaning of e.g. `_SecondType<int>` from "ill-formed" to "well-formed `__nat`." There's no way that's safe.
`_FirstType` and `_SecondType` are exclusively used in `<tuple>` and only in `is_*` contexts. If I'm not mistaken `__nat` should be false in every single case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116621/new/

https://reviews.llvm.org/D116621



More information about the libcxx-commits mailing list