vendredi 14 décembre 2018

Why can I use void(), but not void{}?

Consider the following code:

void foo() { return void(); }
void bar() { return void{}; }

foo() compiles, but bar() doesn't (using GCC 8.2 and clang 7.0 on GodBolt).

Why?

Aucun commentaire:

Enregistrer un commentaire