bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] [Patch 1/2] Libasprintf bug fixes


From: Daiki Ueno
Subject: Re: [bug-gettext] [Patch 1/2] Libasprintf bug fixes
Date: Mon, 04 Mar 2013 20:13:09 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Miguel Ángel <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]