There the obvious difference is that the first version should build and destroy a Foo
.
Then there is an obvious similarity in that both versions do the same thing when calling a function (they build a line, print, etc.).
A less obvious difference is the evaluation of the two expressions. You see, although it is not required for the call Foo
, it is still evaluated as part of the expression:
[class.static] / 1
X X:: s; . , .
. . , Foo
constexpr.