another issue on what(): zero types captured

another issue on what(): zero types captured

HiOn simple another example i still get a "what(): zero types captured" although an arrb data is a member.// using bool so that the capture will recall the function behavior
class PayOffSimple1{private : arbb::f64 strike ; bool bVendeur;public : PayOffSimple1() : strike(0.),bVendeur(true){} PayOffSimple1( arbb::f64 strike_, bool bVendeur_):strike(strike_),bVendeur(bVendeur_){} arbb::f64 operator()( const arbb::f64 & x) const { if (bVendeur) { return arbb::max(arbb::exp(x)-strike,0.); } return -arbb::max(arbb::exp(x)-strike,0.); }};// wrapper to arbbvoid caller1( const arbb::usize & N, const arbb::f64 & strike, const bool & bVendeur){ PayOffSimple1 pay(strike, bVendeur); arbb::dense Sol(N); _for (arbb::usize i= 0 , i < N , ++i) { Sol[i] = pay(static_cast(i)); } _end_for;}// the main loopint main(int argc, char *argv[]){ arbb::usize N_ = 10 ; arbb::f64 strike = 5. ; bool bVendeur1 = true ;// OK PayOffSimple1 paySimple(strike, bVendeur1); arbb::dense sol(N_) ; _for (arbb::usize i= 0 , i < N_ , ++i) { sol[i] = paySimple(static_cast(i)); } _end_for;// error withzero types captured arbb::call(caller1)(N_,strike, bVendeur1); return 0 ;}Can you tell me why is there such error ? strike is an arbb data, so there is something to capture...Sincerely yours

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

A user-defined class must have all its non-static member variables as ArBB types. You can not mix ArBB types and regular C++ types in your class. In your example, you should change "bool bVendeur" to "arbb::boolean bVendeur" as bool is not an ArBB type.

Leave a Comment

Please sign in to add a comment. Not a member? Join today