220 8335 <52C46F6D.7080303@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Proposal: Default swap operation
Date: Wed, 01 Jan 2014 14:41:33 -0500
Lines: 45
Approved: news@gmane.org
Message-ID: <52C46F6D.7080303@gmail.com>
References: <c505e517-1c73-4486-b9dd-9ec15af1e649@isocpp.org> <68012381-8af4-4d62-a5a4-912c454fba96@isocpp.org> <52C4339B.20701@gmail.com> <25282740.R0qdXlWiI6@tjmaciei-mobl2>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
X-Trace: ger.gmane.org 1388605291 6425 80.91.229.3 (1 Jan 2014 19:41:31 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 1 Jan 2014 19:41:31 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBB366SGLAKGQEBMONL7Q@isocpp.org Wed Jan 01 20:41:37 2014
Return-path: <std-proposals+bncBC37LBFWUIFBB366SGLAKGQEBMONL7Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f200.google.com ([209.85.223.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC37LBFWUIFBB366SGLAKGQEBMONL7Q@isocpp.org>)
	id 1VyRfc-00044y-Uh
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Jan 2014 20:41:37 +0100
Original-Received: by mail-ie0-f200.google.com with SMTP id at1sf66685921iec.11
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Jan 2014 11:41:35 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
         :subject:references:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=HpcXog4lUwuaJD6sGf1f1qV8zF+iwMh0zdMlQN7sIfg=;
        b=XUQ3ggEZdm4EXXQ8XuDN6wQlYbXiEL+ltdT7yfeldagRlS1HHAIlwz0bRO6CxOVPkK
         lQbwzEUE2kog4yHmTp3a5jqyFxnXZmJhZXH7OpXxf0RMT0TvJdyEkkjTbiBBGNOpZ3if
         1G9tvWHDEDNNZxlCXQkbltQPE/ShWlyKnT+dU2ZTPj7U8Z4EdiDlzQAVFrvw15e+0g1d
         TPLxMkd4iKgEib0YkYy0hzUhrOA12euANhQuthftsvHZ+/62eYOGxlbsMsGHq/B9dafN
         pNwmmnHKSRGNxgVv5IJ87F8qe6Tkck5D0wUA/F5otKtaR1t6o02lrN2A09B7KEaEoslA
         jxbg==
X-Gm-Message-State: ALoCoQnqD6R/f126i9EuZUOaXA74DYjuMmebwfNBYZuaoAQjnam8R/SEbm69Ifw1HCqrFGg4YGUd
X-Received: by 10.50.33.47 with SMTP id o15mr32296340igi.0.1388605295723;
        Wed, 01 Jan 2014 11:41:35 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.71.142 with SMTP id v14ls4119563qeu.35.gmail; Wed, 01 Jan
 2014 11:41:35 -0800 (PST)
X-Received: by 10.49.120.8 with SMTP id ky8mr135050522qeb.29.1388605295184;
        Wed, 01 Jan 2014 11:41:35 -0800 (PST)
Original-Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [2607:f8b0:4001:c03::234])
        by mx.google.com with ESMTPS id r7si50500801qar.19.2014.01.01.11.41.35
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 01 Jan 2014 11:41:35 -0800 (PST)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c03::234 as permitted sender) client-ip=2607:f8b0:4001:c03::234;
Original-Received: by mail-ie0-f180.google.com with SMTP id tp5so13542939ieb.25
        for <std-proposals@isocpp.org>; Wed, 01 Jan 2014 11:41:34 -0800 (PST)
X-Received: by 10.43.81.200 with SMTP id zz8mr55260330icb.29.1388605294451;
        Wed, 01 Jan 2014 11:41:34 -0800 (PST)
Original-Received: from [192.168.1.181] (tripoint.kitware.com. [66.194.253.20])
        by mx.google.com with ESMTPSA id v2sm68610939igz.3.2014.01.01.11.41.33
        for <multiple recipients>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 01 Jan 2014 11:41:34 -0800 (PST)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
In-Reply-To: <25282740.R0qdXlWiI6@tjmaciei-mobl2>
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c03::234 as
 permitted sender) smtp.mail=mwoehlke.floss@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:8335
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8335>

On 2014-01-01 14:23, Thiago Macieira wrote:
> On quarta-feira, 1 de janeiro de 2014 10:26:19, Matthew Woehlke wrote:
>> Foo::~Foo() = default;
>
> This requires more typing than:
>
> Foo::~Foo() {}

True, though it does express intent more clearly :-). However, that 
exact point was why I mentioned in the previous mail that the dtor is 
not the best example.

(In some pedantic coding styles, '= default;' would be one line where 
'{}' would be mandated to be written '\n{\n}', thus 2 more lines :-).)

> And quite frankly I don't see the benefit. This destructor can't be from other
> translation units under the conditions you described.

Yes. This would need to be changed for the idea to be useful. So there 
is still something that could be changed here; specifying that '= 
default' should make the definition accessible to other translation 
units the same as if a user definition had been provided. (If it is not 
possible to change the behavior of '= default', then I would propose '= 
extern default' instead to explicitly specify that a symbol should be 
emitted.)

> This destructor cannot be trivial either under your condition: if all of them
> were trivial, then you could have left the declaration in the header.

Right. If '= default' appears in the .cpp and not in the .h, the 
compiler shall (be free to) assume that it is non-trivial. Because in 
practice, if you need it in the .cpp and not the .h it is likely 
(always?) because it is non-trivial anyway.

-- 
Matthew

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
