The following code:
symbol x("x");
symbol y("y");
ex test1 = x + y;
for ( size_t i = 0 ; i != test1.nops() ; i++ )
{
try
{
cout << test1.let_op(i) << " " ;
}
catch(std::range_error & ba)
{
cout << "i = " << i << endl;
cout << ba.what() << endl;
}
}
This results:
i = 0
basic::let_op(): add has no operands
i = 1
basic::let_op(): add has no operands
Using op() runs ok but I want change subexpressions.
I am using GiNaC 1.3.3 on Mandriva 2006.0.
Thanks.