TITLE: how many temporaries does it take to add three numbers [ Meyers refers to Scott Meyers, author of "Effective C++". -adc ] PROBLEM: Ell From what I understand Meyers' main objection to returning a pointer, or reference from overloading an operator such as '+' is that memory leaks are guaranteed to occur. Meyers says that a leak must at least occur in complex expressions such as: w = t + q + g This is because, he says, temporaries are generated which the programmers can not access to delete. RESPONSE: clamage@Eng.Sun.COM (Steve Clamage), 22 Jan 96 I think you are missing the context for that observation. The general problem is dealing with a function that logically needs to return a new object. Operator+ is a typical such function, since it does not return either operand, but a new one. Here is a possible schema: T operator+(const T& l, const T& r) { T result; result = ; return result; } Assuming proper constructors and destructors for type T, this schema creates no memory leaks. It can lead to creation and destruction of a lot of extra objects: the local 'result' is copied to the destination of the return, which may in turn be copied. You can sometimes write the code to reduce the number of copies, but typically you cannot eliminate all of them. For example, you might be able to write the body of the function as a single statement: return T( ); which eliminates one temporary inside the function. It does nothing about temporaries which may be required by language semantics elsewhere. To reduce the number of copies, a programmer might decide to return a reference instead. You can't return a reference to an auto object, and returning a reference to a static object causes problems if the function is called twice in the same expression, so you have to return a reference to a heap object: return * new T( ); Now the problem is that in an expression like t + q + g you have no way to get the address of some of the heap objects created by operator+, and so they cannot be deleted. That is the cause of the memory leak. More generally, any resource acquired by T's constructor will not be released.