Boost logo

Boost :

From: John E. Potter (jpotter_at_[hidden])
Date: 2001-03-22 11:24:26

On Thu, 22 Mar 2001, Jeremy Siek wrote:

> I have not made a place for your negative imaginary numbers... is
> there a real ;) reason to have these?


I was thinking of the nanny school which wishes to prevent the user from
doing stupid things. It has a long and respected history of returning
const udt rvalues to prevent modifiable rvalues.

   x = * iter ++ ++;

"works" with standard iterators, but is silly. If the postfix increment
were not a member which returned a non-const rvalue, it would give a
compile error. I'm sure that someone will want an iterator where
operator* returns a const rvalue to prevent

   *iter = x;

I leave the "real" modifier of the "reason" to the politically correct.


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