|
Boost : |
From: Miles Bader (miles.bader_at_[hidden])
Date: 2007-10-04 23:47:00
"John Femiani" <JOHN.FEMIANI_at_[hidden]> writes:
> What is not lightweight about the get<0>(pt) syntax? Doesn't it compile
> away? Is the issue a dependency on another library -- because the
> get<0>(pt) syntax seems really easy to provide without bothering with
> Fusion.
>
> template <int Index> float get(MyPoint & p) {return p[Index];}
> template <> float get<0>(MyPoint & p) {return p.x;}
How does this work with non-constant indices? That's a significant reason
why array-style access is useful ...
-Miles
-- "I distrust a research person who is always obviously busy on a task." --Robert Frosch, VP, GM Research
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk