Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Storing an Expression Template as a Data Member
From: TONGARI (tongari95_at_[hidden])
Date: 2011-01-06 12:03:14


2011/1/7, Hossein Haeri <powerprogman_at_[hidden]>:
> MyClass mc(_1 >> &f >> &g >> &h);
> mc.set_input(-61.1);
> cout << mc.value();//returns h(g(f(-61.1)))
>
> Now, are you telling me that I can store that "_1 >> &f >> &g >> &h" bit in
> a data member of mc using make_expr? If so, what will the type of that data
> member be? Or, are you suggesting a totally different design?

Hi, Hossein. IIUC, you may need some way to abstract the ET away,
maybe by using boost::function, like what Spirit does for its rule
component.

Is this what you want?


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