Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-02-02 08:26:37


on 2/1/00 6:03 PM, Aleksey Gurtovoy at alexy_at_[hidden] wrote:

> 2) probably we need two versions of each 'fill' operator - one with a
> 'const' and another with a non-const reference to the first argument,
> e.g.
>
> | template<class T1, class T2>
> | point<T1, T2>
> | operator <<( const point<T1, T2>&, const POINT& from ) {
> | return point<T1, T2>( from.x, from.y );
> | }
> |
> | template<class T1, class T2>
> | point<T1, T2>&
> | operator <<( point<T1, T2>& to, const POINT& from ) {
> | return to.x( from.x ).y( from.y );
> | }
>
> otherwise (with only 'const' reference version) the result of
> following expression seems strange for me:

Why would we bother with the one taking a const ref to its first argument?


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