Boost logo

Boost Users :

Subject: [Boost-users] [Proto] Lazy function test
From: Noman Javed (noman_bwp_at_[hidden])
Date: 2010-04-28 12:46:12


I am experimenting with the calculator example presented in the proto docs. I am
unable to use pow<> when I define it using the make_expr (as preseneted in
docs), but when I define it like

proto::terminal< struct pow_fun<2> >::type const pow2 = {{}}; it works.

I am using it like that in the main

calculator_context ctx;
ctx.args.push_back(2.0);
std::cout << proto::eval( pow2(_1), ctx ) << std::endl; // ok with terminal
std::cout << proto::eval( pow2(3.0), ctx ) << std::endl; // ok with terminal

How can I make the make_expr version to work?

Thanks in anticipation

Noman Javed
Orléans, France


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