|
|
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
|
|