This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by CaseyCarter on Jul 9 2018, 7:03 PM.

Details

Summary

I'm breaking this up into independent bite-sized ~500 line reviews instead of a single 5200 line monster in hopes that we can turnaround changes quickly.

This first piece implements the new bullet for common_type, and all of common_reference and basic_common_reference. I've conservatively hidden everything behind _LIBCPP_STD_VER > 17, although it could be made available in C++11 mode with some edits.

Diff Detail

Event Timeline

CaseyCarter created this revision.Jul 9 2018, 7:03 PM

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'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++.

CaseyCarter abandoned this revision.May 4 2020, 11:06 AM