Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2002-10-11 04:04:10

Andrei Alexandrescu wrote:
> I believe I have hacked together a complete solution for eliminating
> unnecessary temporary objects in C++. The topic relates to the heavy
> discussions on move constructors, too. The solution (let's call it ZUTO
> (Zero Unnecessary Temporary Objects) henceforth) has the following
> characteristics:

This sounds very promising and I'd love to review it and help you (if I
can). Although I am a bit short of time in the moment, but you claimed
that it's not too complicated if I understand you correctly :))

> We all are aware of the nuisance that unnecessary temporary objects are. We
> are afraid to write elegant code such as:
> extern vector<string> Fun();
> ...
> vector<string> v = Fun();

vector<string>& v = Fun();

is also legal (12.2/5), but I think most people don't know about that
and even fear misuse by beginners...

> const T operator+(const T& lhs, const T& rhs)
> {
> T copy(lhs);
> return copy += rhs;
> }

This is completly wrong, as I already said multiple times. See
operators_1_28_0.patch.gz in the boost files section and search the
mailing list for the corresponding discussion.

> Exactly because the implications might be so deep, I don't want to make a
> fool of myself. Maybe I am making some mistake, or I overlooked something,
> or I hit onto some compiler bug or extension. So I wanted to ask for some
> volunteers to review my article before it goes out. If there are volunteers,
> please write me email. The article will be out in 2 months, and I believe
> I'll have something done in a couple of weeks.

Let me know if you want me to review it.

Regards, Daniel

Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web:

Boost list run by bdawes at, gregod at, cpdaniel at, john at