C++: Life span of temporary arguments?
- by shoosh
When creating a new instance of a MyClass as an argument to a function like so:
class MyClass
{
MyClass(int a);
};
myFunction(MyClass(42));
does the standard make any grantees on the timing of the destructor?
Specifically, can I assume that the it is going to be called before the next statement after the call to myFunction() ?