Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-01-02 19:17:15


> I also think that there are situations where chaining may be very handy.
> Turning back to my version of 'rectangle' class, with a function calls
> chaining you may write something like
>
> r.left( 10 ).right( 20 ).top( 5 ).bottom( 10 );
> instead
> r.assign( 10, 5, 20, 10 );
>
> I know that this looks like a Smalltalk code =), but I think it's very
> convenient to write something like that - first, because you don't have to
> remember the order of arguments in 'assign' method and, second, because it's
> more flexible - you can assign values to any of fourth properties and these
> assignments look as an atomic operation (with a semantic point of view). The
> latter seems to be important quite often. Do you agree?

Cute. I could be convinced...

-Dave


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