3 ms·
It's useful when a function has a out or in/out struct parameter whose value at the end you're not interested in. Or in functions where the struct is an input
by cataphract 4y ago
It's useful when a function has a out or in/out struct parameter whose value at the end you're not interested in. Or in functions where the struct is an input parameter, but they return it as a return value too, which you can then assign to a pointer variable or immediately pass to another function.
Note that the struct values thus created have longer lifetimes than temporary C++ objects created directly inside the argument list of a function call.