This is an archive of the discontinued LLVM Phabricator instance.

[STLExtras] Use std::get in less_first,less_second to support more types
ClosedPublic

Authored by fhahn on Mar 7 2023, 5:08 AM.

Details

Summary

Update less_first,less_second to use std::get to access the first and
second component. This extends support to any type implementing
std::get, like tuples.

Diff Detail

Event Timeline

fhahn created this revision.Mar 7 2023, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 5:08 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
fhahn requested review of this revision.Mar 7 2023, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 5:08 AM
dblaikie accepted this revision.Mar 7 2023, 8:35 AM

Sounds good to me - wouldn't even mind if you wanted to implement a generic abstraction, less<N> and implement less_first/second as aliases of that type.

This revision is now accepted and ready to land.Mar 7 2023, 8:35 AM
fhahn added a comment.Mar 8 2023, 2:57 AM

Sounds good to me - wouldn't even mind if you wanted to implement a generic abstraction, less<N> and implement less_first/second as aliases of that type.

Thanks for taking a look! I am going to land this as is for now, but I can look into generalizing it as follow-up.

This revision was landed with ongoing or failed builds.Mar 8 2023, 3:07 AM
This revision was automatically updated to reflect the committed changes.