Quote Originally Posted by ejohns85
Are they the same?
Effectively, since the second version is likely to be optimised to the first, but if I am not wrong, in theory the second version involves default construction of a temporary and then copy construction of my_class.

Quote Originally Posted by ejohns85
And is the only difference that if I wanted to have a constructor with parameters, I could use the latter to initialize some variables?
No, you can directly initialise with arguments, e.g.,
Code:
MyClass my_class(x, y, z);