vendredi 25 novembre 2016

float initialization from double with braces

Why does the compiler (clang,gcc) not warn about narrowing conversions when doing this

float a{3.14159} 
float a = {double(3.141)}

I expected a warning because I do explicit value-initialization with braces. Following this answer Link it should spit out an error.

Compilation here

Aucun commentaire:

Enregistrer un commentaire