[PATCH] D49118: [libc++] P0898R3 1 of 12: changes to common_type; implement common_reference

Casey Carter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 10 10:49:43 PDT 2018


CaseyCarter added a comment.

In https://reviews.llvm.org/D49118#1157438, @mclow.lists wrote:

> >   I've conservatively hidden everything behind _LIBCPP_STD_VER > 17, although it could be made available in C++11 mode with some edits.
>
> If we have a use for this in pre c++2a code, the libc++ convention would be to implement `__common_reference` that works most everywhere, and then have `common_reference` that only works > 17, but inherits from the ugly name.
>
> That might be difficult in this case, because users can extend `common_reference`.


I was thinking more about implementing the new bullet for `common_type` unconditionally. Despite that it wouldn't quite conform in older modes, it would avoid introducing an obscure difference between 20-mode `common_type` and 11-mode `common_type`. That said, I wouldn't do so in MSFTL so I assumed you wouldn't in libc++.


https://reviews.llvm.org/D49118





More information about the cfe-commits mailing list