Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2004-11-15 17:10:32


"David Abrahams" <dave_at_[hidden]> wrote
> "Andy Little" <andy_at_[hidden]> writes:
>
> > "Andy Little" <andy_at_[hidden]> wrote
> >
> >
> >> tx_matrix<units> t = make_matrix(
> >> translation = xy_pair<units>(units(1),units(1)),
> >> rotation = angle::rad(1),
> >> scaling = .5
> >> );
> >
> > Of course The order of the paramaters in the above example is important,
> > hence rendering the named parameters library unsuitable for this
particular
> > purpose.
> >
> > Apologies for that example
>
> Well, it brings up an interesting point; maybe some sort of visitation
> interface that could explore all parameters in order would be
> appropriate.

I have a feeling its a red herring unfortunately... not really in the same
ballpark as the named parameters library...
eg This should be legal :

// matrix for rotation about (1,1)....

 tx_matrix<units> t = make_matrix(
     translation = make_xy_pair(units( -1),units(-1)), // to origin
     rotation = angle::rad(1),
     translation = make_xy_pair(units(1),units(1)) // ...Oops!
);

The simple,obvious solution would work here I guess:

 tx_matrix<units> t (
     translation( units( -1),units(-1)),
     rotation(angle::rad(1)),
     translation( units(1), units(1))
);

regards
Andy Little


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