220 8337 <52C488CB.3030805@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 16:29:47 -0500
Lines: 38
Approved: news@gmane.org
Message-ID: <52C488CB.3030805@gmail.com>
References: <c505e517-1c73-4486-b9dd-9ec15af1e649@isocpp.org>	<-414611097405781448@gmail297201516>	<52C456C5.8000407@gmail.com>	<1429572.pH5kxD60ME@tjmaciei-mobl2> <CAFk2RUbQ0uHfJUJiVM3mDrpAZW9TZ+1yJkfQnZnQtO3gfHcvFw@mail.gmail.com>
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 1388611784 3883 80.91.229.3 (1 Jan 2014 21:29:44 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 1 Jan 2014 21:29:44 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBBTMRSKLAKGQEOCS6VRY@isocpp.org Wed Jan 01 22:29:51 2014
Return-path: <std-proposals+bncBC37LBFWUIFBBTMRSKLAKGQEOCS6VRY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vc0-f197.google.com ([209.85.220.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBTMRSKLAKGQEOCS6VRY@isocpp.org>)
	id 1VyTMM-0008Vw-H3
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Jan 2014 22:29:50 +0100
Original-Received: by mail-vc0-f197.google.com with SMTP id la4sf15873953vcb.4
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Jan 2014 13:29:49 -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=vnxtqosuHm3Y1c/JpxV/bHz6i21nzqXOsW2BB+dsKLE=;
        b=mmVGSusLJGJ1NbO1Q7cUdQktOKSsAnGzpzZbbsIrFOsJkDcanbXB2PKxPHpWRwGTD5
         5sSl0831aLawdhJPq61Ox4D+KvmLPNNMbvntDKnpWbUGEoNbc7gUMgv6Q+8RpdQbm7/F
         h8ihayBvNRNqjlIaZbq8NCi58D7g5sMBT3cbs8eC/a1vDGNpLmEEzlzivl5AxfbcCoKh
         id+WJAvjttvnltTHTGJ8OsP9L5GgiQZZD0SnHgyVYu4IC2kBRwIlMdPQIuVikKP+vHNO
         05Qkfzvi2c8Ip+TyYe7sgUtZY1Ol0PFkSjom1EwMDcH3PpyZkdUdEKqiwxLXUfN/wH2U
         uKEA==
X-Gm-Message-State: ALoCoQkGeRS3Y3Mj0R8S+qS0n84/GhvMqWnAi3Z3puiRbwWQB1PIuoLBCvmF6dTfP9uEcUywqVzr
X-Received: by 10.58.186.202 with SMTP id fm10mr1457065vec.37.1388611789463;
        Wed, 01 Jan 2014 13:29:49 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.130.195 with SMTP id og3ls4269747qeb.62.gmail; Wed, 01 Jan
 2014 13:29:48 -0800 (PST)
X-Received: by 10.49.120.8 with SMTP id ky8mr135782331qeb.29.1388611788945;
        Wed, 01 Jan 2014 13:29:48 -0800 (PST)
Original-Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [2607:f8b0:4001:c05::229])
        by mx.google.com with ESMTPS id kb1si51606216qeb.151.2014.01.01.13.29.48
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 01 Jan 2014 13:29:48 -0800 (PST)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c05::229 as permitted sender) client-ip=2607:f8b0:4001:c05::229;
Original-Received: by mail-ig0-f169.google.com with SMTP id hk11so40076966igb.0
        for <std-proposals@isocpp.org>; Wed, 01 Jan 2014 13:29:48 -0800 (PST)
X-Received: by 10.50.18.8 with SMTP id s8mr14778983igd.44.1388611788524;
        Wed, 01 Jan 2014 13:29:48 -0800 (PST)
Original-Received: from [192.168.1.181] (tripoint.kitware.com. [66.194.253.20])
        by mx.google.com with ESMTPSA id j16sm70683148igf.6.2014.01.01.13.29.47
        for <multiple recipients>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 01 Jan 2014 13:29:48 -0800 (PST)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
In-Reply-To: <CAFk2RUbQ0uHfJUJiVM3mDrpAZW9TZ+1yJkfQnZnQtO3gfHcvFw@mail.gmail.com>
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:c05::229 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:8337
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8337>

On 2014-01-01 14:53, Ville Voutilainen wrote:
> On 1 January 2014 21:24, Thiago Macieira <thiago@macieira.org> wrote:
>> On quarta-feira, 1 de janeiro de 2014 12:56:21, Matthew Woehlke wrote:
>>>> Huh? I'm pretty sure this is already allowed.
>>>
>>> Hmm... gcc at least seems to allow it :-D. I guess I assumed it wasn't,
>>> as I cant recall that any of the 'what's new in C++11' I've read
>>> mentioned it...
>>
>> It is, but note that it doesn't emit a symbol for other translation units to
>> see. The program is ill-defined if any translation unit trying to destroy Foo
>> doesn't see the = default.
>
>
> I don't see any wording in the standard that would require other TUs to
> see the =default to use the function.

I'm inclined to agree. I didn't consult the spec, but when I tried using 
it in a project, I am not seeing link errors that I would expect if the 
definition wasn't available to other TU's. (And I *do* see link errors 
if I omit the dtor definition entirely, so the dtor is definitely being 
referenced.)

I'd also be curious about your reading of the spec. It may be that 
technically such a program is ill-formed, but existing compilers (or at 
least gcc) "DTRT" (i.e. behave in the desired manner) 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/.

.
