Access a function's return value in C++ scope guard
It is best to avoid accessing a function's return value in a scope guard or we need to be really careful about the return value's lifetime.
Happy case
Scope guard is a simple RAII concept in C++ that, in most cases, just works.
struct ScopeGuard {
ScopeGuard(std::vector