In c++17 you can do the following:
if ( init-statement(optional); condition )
according to https://en.cppreference.com/w/cpp/language/if
However my compiler (vs2019) allows
if ( init-statement )
where the init-statement is also the condition. I can't find that this is documented anywhere, is this actually guaranteed to work?
Aucun commentaire:
Enregistrer un commentaire