Compare the following two pieces of code, the first using a reference to a large object, and the second has the large object as the return value. The emphasis on a \"large o
A somewhat idiomatic solution would be:
std::auto_ptr getObjData() { std::auto_ptr a(new LargeObj); a->fillWithData(); return a; } int main() { std::auto_ptr a(getObjData()); }