Implements parts of:
- P0898R3 Standard Library Concepts
- P1754 Rename concepts to standard_case for C++20, while we still can
Paths
| Differential D74292
[libcxx] adds concept std::derived_from ClosedPublic Authored by cjdb on Feb 8 2020, 9:16 PM.
Details
Summary Implements parts of:
Diff Detail
Event TimelineHerald added subscribers: libcxx-commits, ldionne, christof. · View Herald TranscriptFeb 8 2020, 9:16 PM
cjdb marked 2 inline comments as done. Comment ActionsUpdates tests to check for fundamental(ish) types, cv-qualifiers, references, pointers, void, functions, pointer-to-functions, reference-to-functions, pointer-to-member(-functions), and arrays.
cjdb added a child revision: D77961: [libcxx] adds concept `std::convertible_to`.Apr 11 2020, 10:30 PM Comment Actions One correctness comment and some minor nits
cjdb marked 2 inline comments as done. Comment Actions I added the LLVM Monorepo to the revision - this will allow CI to trigger if you update the patch. Can you please rebase and re-upload? This LGTM if CI passes, but I think you might need to use is_convertible_v to fix the build on GCC. CI will tell. This revision is now accepted and ready to land.Jan 28 2021, 8:41 AM Comment Actions
Done, but I don't see any CI panel showing up. Did I do something wrong? cjdb retitled this revision from [libcxx] adds [concept.derived] to [libcxx] adds concept std::derived_from. Comment Actionsupdates commit message This revision now requires changes to proceed.Feb 9 2021, 3:30 PM This revision is now accepted and ready to land.Feb 10 2021, 8:53 AM Closed by commit rGc63de225fdd7: [libcxx] adds concept std::derived_from (authored by cjdb). · Explain WhyFeb 10 2021, 11:30 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 322769 libcxx/include/concepts
libcxx/test/std/concepts/lang/derived.compile.pass.cpp
|
As before, this needs _Uglification.
Also note that is_base_of_v directly goes back to __is_base_of and you have the chain
__is_base_of -> i_base_of -> is_base_of_v
(See https://github.com/miscco/llvm-project/blob/bc29069dc401572ba62f7dd692a3474c1ead76c9/libcxx/include/type_traits#L1417-L1425)
So throughput would be better it you would again specialize for __clang__ and use __Is_base_of directly