mercredi 29 août 2018

Is double braced scalar initialization allowed by C++ standard?

I have following code:

int x = ;

Is this syntax valid according to C++ standard (I'm interested in C++11 and later)?

When using the latest compilers there is no problem, however in some older ones (e.g. gcc 4.8.5) it gives following error:

error: braces around scalar initializer for type 'int'

Aucun commentaire:

Enregistrer un commentaire