Hi
Trying to have large arbb function, i face a problem with executing function captured by arbb.
Here is the small exemple i took :
// a small class
class PayOffSoSimple
{
public :
PayOffSoSimple() {}
PayOffSoSimple( const PayOffSoSimple & pay)
{}
arbb::f64 operator()() const
{
return 1.;
}
};
// a first caller with payoff function instanciated inside the caller
void caller_( const arbb::usize & N)
{
PayOffSoSimple pay;
arbb::dense Sol(N);
_for (arbb::usize i= 0 , i < N , ++i)
{
Sol[i] = pay();
}
_end_for;
}
// a second one with the pay off as argument
void caller( const PayOffSoSimple & pay, const arbb::usize & N)
{
arbb::dense Sol(N);
_for (arbb::usize i= 0 , i < N , ++i)
{
Sol[i] = pay();
}
_end_for;
}
int main(int argc, char *argv[])
{
arbb::usize N_ = 10 ;
PayOffSoSimple paySoSimple;
// OK
arbb::dense sol(N_) ;
_for (arbb::usize i= 0 , i < N_ , ++i)
{
sol[i] = paySoSimple();
}
_end_for;
// OK
arbb::call(caller_)(N_);
// exception
arbb::call(caller)(paySoSimple,N_);
return 0 ;
}
here is the exception :
terminate called after throwing an instance of 'arbb_2::exception'
what(): zero types captured
Aborted
Why is the second caller impossible to use ?
Thank you
Sincerely yours.
Passing class to arbb code
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.



