Page MenuHomePhabricator

[libc++][P2321R2] Add specializations of basic_common_reference and common_type for pair

Authored by philnik on Jan 17 2022, 11:55 AM.



Add specializations of basic_common_reference and common_type for pair

Diff Detail

Event Timeline

philnik requested review of this revision.Jan 17 2022, 11:55 AM
philnik created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2022, 11:55 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Looks good to me, modulo some nits and scope-creep followup ideas.


Let's make this easy to compare to lines 320-321 at a glance.


Let's keep the deduction guide for pair located right after class pair; both because it's more tightly "related" to the class than these partial specializations, and so that the library additions remain in chronological order (C++03, then C++17 deduction guide, then C++2b specializations).


Let's pick one style and be consistent here: either one-line all of these like lines 202, 203, etc; or two-line them all like lines 204-205, 206-207, etc.


Should this say common_type_t instead of common_reference_t? or what's this line doing here? Ditto below.
And/or, should this line be moved to common_reference.compile.pass.cpp?

Orthogonally, and probably in a separate NFC commit, can common_type.pass.cpp be renamed to common_type.compile.pass.cpp (and eliminate its main)?

philnik updated this revision to Diff 400633.Jan 17 2022, 1:37 PM
philnik marked 4 inline comments as done.
  • Address comments

I already thought about making this .compile.pass.cpp. That's why I put the static_asserts originally below the main in D116538. I'll make a follow-up PR.

Mordante accepted this revision.Feb 1 2022, 11:19 AM

LGTM, modulo one small issue. Please rebase to make sure the CI becomes green.


Please update the synopsis in <utility>.

This revision is now accepted and ready to land.Feb 1 2022, 11:19 AM
philnik updated this revision to Diff 405060.Feb 1 2022, 12:39 PM
philnik marked an inline comment as done.
  • Rebased
  • Add synopsis