Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-02-03 07:51:21


on 2/2/00 9:55 PM, Aleksey Gurtovoy at alexy_at_[hidden] wrote:

> We can live without it, but in that case some operations seem to be
> counter-intuitive (for me) and also a less effective, e.g.:
>
> | typedef boost::geometry2d::point<long> point;
> | point p1;
> | POINT p2( POINT() << p1 );
> | p2 << p1; // do nothing
> | p2 = p2 << p1; // ok, convert p1 to a temporary object and assign the
> temporary to p2

I find the idea of relying on "p2 << p1" to change p2 when p2 is non-const
but still being able to use the same expression to produce a temporary when
p2 is const kind of wierd. Normally in C++ if an expression modifies one of
its arguments when it is non-const, if the argument becomes const the
expression becomes invalid.

-Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk