Boost logo

Boost :

From: Paul Hollingsworth (boost_at_[hidden])
Date: 2001-07-17 09:57:54

> Hello,
> i don't think your approch is a better one....this needs space and
> a kind of copy operator has to be called internally.

I suspect that without looking at the generated code on some popular
compilers, it is not obvious that returning a copy of the iterator is
going to be less efficient than the alternatives.

The compiler is free to optimise out redundant calls to the copy
constructor. This is a situation in which the Return Value
Optimisation might come into play, for example.

In any case, my point was that most programmers (which is what I
meant by the phrase "average programmers") really don't (and should
not) care about micro-inefficiencies like this, and would prefer a
more uniform and hence less error prone interface.

Paul Hollingsworth

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