This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Add __is_callable type trait and begin granularizing type_traits
ClosedPublic

Authored by philnik on Apr 5 2022, 3:13 AM.

Details

Summary

__is_callable is required to ensure that the classic algorithms are only called with functions or functors. I also begin to granularize <type_traits>.

Diff Detail

Event Timeline

philnik created this revision.Apr 5 2022, 3:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 3:13 AM
Herald added a subscriber: mgorny. · View Herald Transcript
philnik requested review of this revision.Apr 5 2022, 3:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 3:13 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Apr 6 2022, 9:22 AM

LGTM with green CI.

libcxx/include/__type_traits/bool_constant.h
21 ↗(On Diff #420434)

Since those are so small, I would be in favor of putting them in integral_constant.h directly. I don't have a *strong* preference, though.

libcxx/include/type_traits
1261

For anyone looking at this and wondering the reason for this removal, we have the exact same code in __utility/declval.h.

This revision is now accepted and ready to land.Apr 6 2022, 9:22 AM
philnik updated this revision to Diff 420968.Apr 6 2022, 12:15 PM
philnik marked an inline comment as done.
  • Address comments
  • Fix CI
philnik updated this revision to Diff 420998.Apr 6 2022, 1:26 PM
  • Include the correct header
philnik updated this revision to Diff 421133.Apr 7 2022, 2:08 AM
  • Fix CI
philnik updated this revision to Diff 421160.Apr 7 2022, 4:41 AM
  • Try to fix CI
This revision was landed with ongoing or failed builds.Apr 8 2022, 3:24 AM
This revision was automatically updated to reflect the committed changes.