[libcxx-commits] [PATCH] D96657: [libcxx] adds common_reference to <type_traits>
Michael Schellenberger Costa via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Feb 19 09:56:52 PST 2021
miscco added inline comments.
================
Comment at: libcxx/include/type_traits:2471
+
+// COMMON-REF(A, B) is COND-RES(COPYCV(X, Y) &, COPYCV(Y, X) &)
+// if that type exists and is a reference type.
----------------
I think it would not hurt to add the standardese for X and Y too
================
Comment at: libcxx/include/type_traits:2492
+
+// Otherwise, let C be remove_reference_t<COMMON-REF(X&, Y&)>&&. If A and B are both
+// rvalue reference types, C is well-formed, and ...
----------------
Is there a reason for the deep identation?
================
Comment at: libcxx/include/type_traits:2494
+// rvalue reference types, C is well-formed, and ...
+template <class _Tp, class _Up>
+using __common_ref_C = remove_reference_t<__common_ref<_Tp&, _Up&>>&&;
----------------
I think we should go with `_Xp` and `_Yp` here
================
Comment at: libcxx/include/type_traits:2508
+// Otherwise, let D be COMMON-REF(const X&, Y&).
+template <class _Tp, class _Up>
+using __common_ref_D = __common_ref<const _Tp&, _Up&>;
----------------
Same would use `_Xp` and `_Yp`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96657/new/
https://reviews.llvm.org/D96657
More information about the libcxx-commits
mailing list