POV-Ray : Newsgroups : povray.off-topic : OO theory? Python. : Re: OO theory? Python. Server Time
28 Jul 2024 22:22:25 EDT (-0400)
  Re: OO theory? Python.  
From: Le Forgeron
Date: 13 Oct 2012 14:49:24
Message: <5079b7b4$1@news.povray.org>
Le 13/10/2012 20:38, Warp nous fit lire :
> Le_Forgeron <jgr### [at] freefr> wrote:
>>   Vector & operator +(const Vector &v2) const
>>   {
>>      return Vector(
>> this.internal_storage[0]+v2.internal_storage[0],
>> this.internal_storage[1]+v2.internal_storage[1],
>> this.internal_storage[2]+v2.internal_storage[2] );
>>   }
> 
> You are returning a reference to a temporary. Kaboom.
> 
Yes. I do not know why I did that (nor put a space before the +).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.