Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2000-02-03 19:55:13


Dave Abrahams <abrahams_at_[hidden]> wrote:
> 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.
>

Now I see some problems with that too - suppose we have 'point p1' which
used somewhere in a code like

| POINT p2;
| // ...
| p1 << p2;

And later we decide to change the definition of p1 to 'const point' - now
our code is silently broken...
So we return to 'make_point'??

-Alexy


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