[GiNaC-list] Getting a pointer to an element in a list?
John Pye
john.pye at student.unsw.edu.au
Wed Aug 17 02:26:24 CEST 2005
I want to update the expression from outisde the class, ie something like
ex &x = myobject->getExpression(17);
x = x.subs(y==5);
How would you suggest I did that? I think that a copy constructor is
getting called somewhere but I haven't worked out where yet.
Cheers
JP
Christian Bauer wrote:
>Hi!
>
>On Wed, Aug 17, 2005 at 01:25:16AM +1000, John Pye wrote:
>
>
>> const ex * getExpressionPtr(const unsigned &i) const{
>> *return* &(F[i]);
>> }
>>
>>
>
>Hm, why do you want to do this? An 'ex' is already a pointer to something,
>so I don't see much advantage over
>
> ex getExpression(unsigned i) const { return F[i]; }
>
>Bye,
>Christian
>
>
>
More information about the GiNaC-list
mailing list