On Sat, 25 Mar 2023, 11:29 Filippo Bistaffa, wrote: > I'm not sure I fully understand that quote: double can be converted to > float (even if float has a lower rank) because they are both "standard", > whereas the same doesn't apply to std::float16_t? > Correct. float16_t is an extended floating-point type. https://en.cppreference.com/w/cpp/language/types#Floating-point_types > On Fri, Mar 24, 2023, 21:22 Jonathan Wakely wrote: > >> >> >> On Fri, 24 Mar 2023, 17:05 Filippo Bistaffa via Gcc-help, < >> gcc-help@gcc.gnu.org> wrote: >> >>> I was playing around with gcc-trunk's support for C++23's std::float13_t >>> and I found out that, while float is constructible from double, as far >>> as I >>> can tell std::float13_t is not. >>> In other words, the following code compiles OK: >>> >>> #include >>> #include >>> int main() { >>> std::vector x(5); >>> std::vector y(std::begin(x), std::end(x)); >>> } >>> >>> whereas the following does not: >>> >>> #include >>> #include >>> int main() { >>> std::vector x(5); >>> std::vector y(std::begin(x), std::end(x)); >>> } >>> >>> See this snippet . >>> Am I missing something or is it supposed to be like that? >>> >> >> Yes, this is the correct behaviour. The C++23 standard says: >> >> "A prvalue of floating-point type can be converted to a prvalue of >> another floating-point type with a greater or equal conversion rank ( >> [conv.rank] ). >> A prvalue of standard floating-point type can be converted to a prvalue >> of another standard floating-point type." >> >> >> >>