std::derived_from(3cxx)
π std::derived_from β from the 3cxx manual π
okay bestie, pull up a chair, because today we're learning about a concept, and not in the abstract "what is the meaning of life" way β in the C++20 way. this is a page from the libstdc++ manual and it's about to be your new fave. no cap. π¦
β¨ NAME β¨
std::derived_from β [concept.derived], the concept derived_from
like... the name is the whole vibe. it checks if one thing derives from another thing. iconic behaviour honestly. π
πΈ SYNOPSIS πΈ
first thing's first, you gotta let it into your life:
#include <concepts>
that's the gate. that's the whole entrance exam. header included, concept unlocked, periodt. π₯
π Concept definition π
here's the actual shape of it, and yes you're gonna look at every single character because this is the exact definition:
template<typename _Derived, typename _Base>
concept std::derived_from = __is_base_of(_Base, _Derived)
&& is_convertible_v<const volatile _Derived*, const volatile _Base*>
so the way this works, bestie: it's a concept with two template parameters, _Derived and _Base, and it's true when both of these hold β __is_base_of(_Base, _Derived) is true, and is_convertible_v<const volatile _Derived*, const volatile _Base*> is true. two conditions, one &&, no shortcuts. it's giving "both boxes checked or we don't move." π
π DESCRIPTION π
[concept.derived], concept derived_from. that's the detailed description, and honestly? it's short and it knows it. some entries ramble, this one serves. β¨
π«Ά Author π«Ά
Generated automatically by Doxygen for libstdc++ from the source code.
so like, a robot wrote this part. don't @ me, I just report the facts. π
and that's the whole page, bestie! shoutout to libstdc++ for the 3cxx manual this came from β mwah, thanks for the source, love u, bye! πππ¦πΈπ
π¦ where this page comes from
- ubuntu resolute: libstdc++-12-doc 12.5.0-9ubuntu1
- ubuntu resolute: libstdc++-13-doc 13.4.0-10ubuntu1
- ubuntu resolute: libstdc++-16-doc 16-20260322-1ubuntu1
- ubuntu stonking: libstdc++-12-doc 12.5.0-9ubuntu1
- ubuntu stonking: libstdc++-13-doc 13.5.0-1ubuntu1
- ubuntu stonking: libstdc++-16-doc 16.2.0-3ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms