[libcxx-commits] [PATCH] D96660: [libcxx] adds concept `std::common_reference_with`

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 14 06:26:14 PST 2021


Mordante added inline comments.


================
Comment at: libcxx/include/concepts:176
 
+// [concept.commonreference]
+template<class _Tp, class _Up>
----------------
Minor nitpick the section is called `[concept.commonref]`.


================
Comment at: libcxx/include/concepts:181
+  convertible_to<_Tp, common_reference_t<_Tp, _Up>> &&
+  convertible_to<_Up, common_reference_t<_Up, _Tp>>;
+
----------------
I know it behaves the same, but is there a reason you use `common_reference_t<_Up, _Tp>` instead of `common_reference_t<_Tp, _Up>` as specified in the standard?


================
Comment at: libcxx/test/std/concepts/lang/commonreference.compile.pass.cpp:54
+static_assert(CheckCommonReferenceWith<int, unsigned char>());
+static_assert(CheckCommonReferenceWith<int, __int128_t>());
+static_assert(CheckCommonReferenceWith<int, double>());
----------------
Can you guard this with `#ifndef _LIBCPP_HAS_NO_INT128`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96660



More information about the libcxx-commits mailing list