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