std::experi...DerivedFrom(3)
π NAME π
okay bestie, welcome to the std::experi...DerivedFrom(3) page from the C++ Standard Libary manual β yes, βLibaryβ with one βrβ, thatβs the headerβs vibe, iykyk. This page is about std::experimental::ranges::DerivedFrom, and the NAME line is literally std::experimental::ranges::DerivedFrom β std::experimental::ranges::DerivedFrom. No cap, thatβs the whole thing. π
β¨ Synopsis β¨
Defined in header <experimental/ranges/concepts>:
template< class T, class U >
concept bool DerivedFrom =
std::is_base_of<U, T>::value &&
(ranges TS)
std::is_convertible<std::remove_cv_t<T>*,
std::remove_cv_t<U>*>::value;
The concept DerivedFrom<T, U> is satisfied if and only if U is a class type that is either T or a public and unambiguous base of T. Thatβs the whole requirement, bestie β no extra credit. π«Ά
Okay but hereβs the tea: despite the use of std::is_base_of and std::is_convertible in its description above, DerivedFrom is not required to use it in its implementation. So there need not be any subsumption relationship between DerivedFrom<T, U> and std::is_base_of<U,T>::value or std::is_convertible<std::remove_cv_t<T>*, std::remove_cv_t<U>*>::value. Like, the description above uses those helpers, but the implementation doesnβt have to β the vibe is adjacent, not mandatory. π
π See also π
is_base_ofβ checks if a type is derived from the other type.(C++11)(class template)is_convertibleβ checks if a type can be converted to the other type.(C++11)(class template)is_nothrow_convertibleβ checks if a type can be converted to the other type.(C++20)(class template)
sign-off bestie: source is http://cppreference.com, version/date is 2024.06.10, and the page tag is std::experi...DerivedFrom(3) β go off, read the docs, and hydrate while youβre at it πβ¨πΈ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms