[PATCH] D27606: [libcxx] Fix tuple construction/assignment from types derived from tuple/pair/array.

Michael Park via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 13 13:10:42 PST 2016


mpark added inline comments.


================
Comment at: include/tuple:568
+            using _QualType = typename _Deduced::_QualType;
+           static_assert(__tuple_like<typename _Deduced::_RawType>::value, "");
+            return __tuple_constructible<_QualType, tuple>::value
----------------
indentation?


================
Comment at: include/tuple:871
     template <class _Alloc, class _Tuple,
+               class _Deduced = __deduce_tuple_like<_Tuple>,
+              class _TupBase = typename _Deduced::_QualType,
----------------
indentation?


================
Comment at: include/tuple:906
     template <class _Tuple,
+              class _Deducer = __deduce_tuple_like<_Tuple>,
+              class _QualTupleBase = typename _Deducer::_QualType,
----------------
`s/_Deducer/_Deduced/`


================
Comment at: include/tuple:907
+              class _Deducer = __deduce_tuple_like<_Tuple>,
+              class _QualTupleBase = typename _Deducer::_QualType,
               class = typename enable_if
----------------
`s/_QualTupleBase/_TupBase/`


================
Comment at: include/tuple:915
         tuple&
-        operator=(_Tuple&& __t) _NOEXCEPT_((is_nothrow_assignable<base&, _Tuple>::value))
+        operator=(_Tuple&& __t) _NOEXCEPT_((is_nothrow_assignable<base&, _QualTupleBase>::value))
         {
----------------
A general comment about using the `base` in noexcept condition. I remember for `variant` we wanted to express it directly rather than delegating it to the "base". Does that also apply here?


================
Comment at: include/tuple:917
         {
-            base_.operator=(_VSTD::forward<_Tuple>(__t));
+            base_.operator=(_VSTD::forward<_QualTupleBase>(__t));
             return *this;
----------------
Here and elsewhere, why do we bother with `base_.operator=(...);` as opposed to just `base_ = ...;`?


https://reviews.llvm.org/D27606





More information about the cfe-commits mailing list