3 ms·
> then call a method on that temporary which returns a reference to within the temporary The obvious answer to this would be never to return references to memb
by nly 9y ago
> then call a method on that temporary which returns a reference to within the temporary
The obvious answer to this would be never to return references to members (or anything tied to the objects lifefime), but if you really must then you can always use a qualifier to prevent this pattern from compiling.
https://ideone.com/UuZYJe https://ideone.com/UuZYJe