Page MenuHomePhabricator

[libc++][math.h][NFC] Refactor enable_ifs
ClosedPublic

Authored by philnik on Nov 5 2022, 1:56 PM.

Details

Diff Detail

Event Timeline

philnik created this revision.Nov 5 2022, 1:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2022, 1:56 PM
philnik requested review of this revision.Nov 5 2022, 1:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2022, 1:56 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante accepted this revision.Nov 10 2022, 8:37 AM

Nice cleanup, thanks. If the CI is happy, I'm happy.

This revision is now accepted and ready to land.Nov 10 2022, 8:37 AM
ldionne accepted this revision.Nov 21 2022, 8:26 AM

LGTM pending CI.

libcxx/include/math.h
321–322

I don't think that is valid in C++03, but maybe Clang accepts it as an extension. In all case, I'm OK if the CI's happy.

EricWF added a subscriber: EricWF.Nov 21 2022, 9:55 AM

Why is this a cleanup?

Why is this a cleanup?

Because it separates SFINAE and the return type, and moves to the enable_if style we agreed on using (template <..., __enable_if_t<condition, int> = 0>). Reminds me that we wanted to document this somewhere.

This revision was landed with ongoing or failed builds.Nov 22 2022, 11:36 AM
This revision was automatically updated to reflect the committed changes.