Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Higher order function
From: Noman Javed (noman_bwp_at_[hidden])
Date: 2010-04-27 16:46:41


Eric Niebler <eric <at> boostpro.com> writes:

> Now Array is a full proto terminal type, and expressions involving them
> will build expression trees.
>
I have tried that Array code, its working. But when I try to print the contents
of the Array directly through std::cout it gives me errors. Should I need to
implement a printcontext ?

 
> It doesn't look to me like there is anything lazy about apply. So it
> isn't part of your expression template. Rather, it accepts expressions
> and an evaluator, and evaluates it.
>
> There may be a more elegant solution. What are your evaluators?
>

The idea is to implement lazy evaluated expressions like e.g

Array<int> res = evaluate(apply(inc,apply(add,apply(dec,data1),data2) ) );

where inc is a user defined increment function or function object
data1 and data2 are already created Array<int>


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