std::convertible_to(3cxx)
β¨ std::convertible_to(3cxx) β¨
okay bestie, so std::convertible_to is a thing and it lives in libstdc++ and it's literally a concept π
from the <concepts> girlies, specifically the one catalogued as [concept.convertible]. It's the "concept convertible_to". That's the name, that's the vibe. Periodt.
πΈ NAME πΈ
std::convertible_to β [concept.convertible], concept convertible_to π¦
β¨ SYNOPSIS β¨
First things first, you gotta let it in the door:
#include <concepts>
π Concept definition π
here's the whole glow-up, no cap, copy it exactly:
template<typename _From, typename _To>
concept std::convertible_to = is_convertible_v<_From, _To>
&& requires { static_cast<_To>(std::declval<_From>()); }
so the way that works π β it's is_convertible_v<_From, _To> AND a requires clause that checks static_cast<_To>(std::declval<_From>()) actually compiles. Both. Not one or the other. Both. It's giving "you have to pass the vibe check AND the follow-up vibe check" π
π Detailed Description π
[concept.convertible], concept convertible_to. fr fr. that's the whole lore β¨
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. not me getting auto-generated π iconic behaviour honestly, it wrote itself π«Ά
okay that's the whole page bestie, love that for us π this lil masterpiece came straight out of libstdc++, and yes std::convertible_to(3cxx) really is the whole header/footer situation up in here. byeeee πΈπ¦β¨
π¦ 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