dimanche 4 avril 2021

Creating a variable like x = func(); function call and var creation order defined?

auto x = func();
int x = func();

I believe it should be defined that call to the func will always happened first, before memory allocation for x, for the case with auto, but couldn't found info about it.

Is it so?
And is it defined for the case when type is explicitly written?

 auto x = f1() * f2() + static_cast<int>(f3());

And is it to write something like the above?v

Is there a standard section where it's defined when the evaluation of the auto type happens?

Aucun commentaire:

Enregistrer un commentaire