Boost logo

Boost Users :

From: Paul Giaccone (paulg_at_[hidden])
Date: 2006-04-06 04:42:55


james.jones_at_[hidden] wrote:

>As to mapping, it would be nice to be able to write code like:
>
>double v = expr1(x=5,y=10);
>double w = expr2(x=2,y=3,z=8);
>
>I should think the Boost parameter library could handle this.
>
>Actually, maybe you don't even need the Boost parameter library. Just define operator() on expression to ignore its arguments (then x=5, y=10 sets the values of x and y, and expr1 is then evaluated in that context).
>
>
I agree - this is a more natural notation, as it is closer to what a
mathematician would write ("v = expr1(x, y) where x = 5 and y= 10").
Using arrows ("->") looks odd to a mathematician's eyes, as that means
"maps to", and it is expr1 that does the mapping, not the variables.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net