in generated stubs: Detect if object is returned and if so return std::move of it