POV-Ray : Newsgroups : povray.programming : Improved intersection routine for CSG-Intersection objects : Re: Improved intersection routine for CSG-Intersection objects Server Time
6 Oct 2024 20:20:11 EDT (-0400)
  Re: Improved intersection routine for CSG-Intersection objects  
From: Thorsten Froehlich
Date: 14 Dec 2003 19:27:49
Message: <3fdd0005$1@news.povray.org>
In article <3fdce9c8@news.povray.org> , Wolfgang Wieser <wwi### [at] gmxde>  
wrote:

> First of all, the copy constructor and assignment operators will
> introduce overhead:
>
> tempate<classT>
>  auto_ptr<T>& auto_ptr<T>::operator=(auto_ptr<T>& rhs)
>  {
>    if (this != &rhs)
>    {
>      delete pointer;   // <-- if(pointer) { destruct & free }
>      pointer = rhs.pointer;
>      rhs.pointer = 0;
>    }
>    return *this;
>  }

No, what you show introduces no overhead when used.  If you would do the
same without an auto_ptr you would need to write exactly the same code.
Consequently, there is no overhead - the code is just created for you rather
than you having to write it.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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