Does C++ provide a guarantee for the lifetime of a temporary variable that is created within a function call but not used as a parameter? Here\'s an example class:
StringBuffer is in the scope of GetString. It should get destroyed at the end of GetString's scope (ie when it returns). Also, I don't believe that C++ will guarantees that a variable will exist as long as there is reference.
The following ought to compile:
Object* obj = new Object;
Object& ref = &(*obj);
delete obj;