C++11/14 and return( ... ) vs return
- by user2485710
In C++ you are allowed to write a return statement that looks like :
return ( ... );
which is different from the more popular :
return ... ;
In particular the first version returns the address/reference of something that is local to the stack of the function which contains that return statement.
Now why something would like to return a reference to something that, at that point, has no lifetime ?
What are the use case for this idiom ? Considering the new buzzword and features from C++11 and C++14 there is a different usage for this ?