Miguel Ángel <[email protected]> writes:

> +  /* Copy constructor.  Necessary because the destructor is nontrivial.  */
> +  autosprintf& autosprintf::operator = (const autosprintf& copy)
> +  {
> +    if (this != &copy)
> +      {
> +        autosprintf tmp(copy);
> +        std::swap (tmp.str, this->str);
> +      }
> +    return *this;
> +  }
> +

I'm not familiar with C++, but is 'tmp' really needed here?

    autosprintf& operator = (autosprintf& src)
    {
      std::swap (str, src.str);
      return *this;
    }

Regards,
-- 
Daiki Ueno

Reply via email to