220 8327 <la1egb$ang$1@ger.gmane.org> article
Path: news.gmane.org!not-for-mail
From: Bo Persson <bop@gmb.dk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Proposal: Default swap operation
Date: Wed, 01 Jan 2014 17:07:53 +0100
Lines: 53
Approved: news@gmane.org
Message-ID: <la1egb$ang$1@ger.gmane.org>
References: <c505e517-1c73-4486-b9dd-9ec15af1e649@isocpp.org> <CAPBZbvxzF1pgzaa=A5KfWDTeX7o0epwWiH5+YES+7u4eX2SG0Q@mail.gmail.com> <68012381-8af4-4d62-a5a4-912c454fba96@isocpp.org> <52C4339B.20701@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 1388592485 11351 80.91.229.3 (1 Jan 2014 16:08:05 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 1 Jan 2014 16:08:05 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCZ6RLW3UIKBB2H2SCLAKGQEREMJB5I@isocpp.org Wed Jan 01 17:08:09 2014
Return-path: <std-proposals+bncBCZ6RLW3UIKBB2H2SCLAKGQEREMJB5I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-we0-f198.google.com ([74.125.82.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCZ6RLW3UIKBB2H2SCLAKGQEREMJB5I@isocpp.org>)
	id 1VyOL2-0006fi-Uk
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Jan 2014 17:08:09 +0100
Original-Received: by mail-we0-f198.google.com with SMTP id q58sf22055666wes.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Jan 2014 08:08:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:user-agent: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=OwYhyNmEF/9tF7N6vBmIb0MZ4OhYB5j+baztItb7HTg=;
        b=LL4hX86tUnOazE3dLSA24wOb8gHpZC3klLnA8h8gYfNXUDu1iHqbsnKkGNowdLtx7p
         XccySANLDAMVpsfBjXCGfoQ6Q977alLs4pIcAgr5OsCm2mg8JWUwv7kYWi4lMob5+8LR
         52QY+41kS13Ch2KUf2qelK59DPpS5vsLCuxy5oT003ECh5qZf1sSeAVpuvVfnKzrZFfQ
         QLna9HRQ2wLtddQHA3yRE+wWu+3OSLdOJ3/uljnfX3HMmAMEV9ulykrm5dtrHlectyBT
         mZEUL7fQ6FMSWOIp7H+I9EkMC7YPpjRkKgxZtNelZEUMtBWWyZqH4/KKOpdq1dwgDx5M
         QE9g==
X-Gm-Message-State: ALoCoQkjRhy8NfKgsqvBIYAfUGZ6PfpwatSUUbECHiWvffc7xTnwGNuYJD1uAIIpsnsYaBqjua++
X-Received: by 10.152.9.36 with SMTP id w4mr30442410laa.0.1388592488480;
        Wed, 01 Jan 2014 08:08:08 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.37.99 with SMTP id x3ls530834laj.18.gmail; Wed, 01 Jan
 2014 08:08:07 -0800 (PST)
X-Received: by 10.152.120.231 with SMTP id lf7mr17247489lab.36.1388592487686;
        Wed, 01 Jan 2014 08:08:07 -0800 (PST)
Original-Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by mx.google.com with ESMTPS id h4si26759723lam.116.2014.01.01.08.08.07
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Wed, 01 Jan 2014 08:08:07 -0800 (PST)
Received-SPF: pass (google.com: domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Original-Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1VyOL1-0006aN-0U
	for std-proposals@isocpp.org; Wed, 01 Jan 2014 17:08:07 +0100
Original-Received: from c193-14-6-157.cust.tele2.se ([193.14.6.157])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Wed, 01 Jan 2014 17:08:07 +0100
Original-Received: from bop by c193-14-6-157.cust.tele2.se with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Wed, 01 Jan 2014 17:08:07 +0100
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 44
Original-X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: c193-14-6-157.cust.tele2.se
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To: <52C4339B.20701@gmail.com>
X-Original-Sender: gclcip-std-proposals@m.gmane.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as
 permitted sender) smtp.mail=gclcip-std-proposals@m.gmane.org
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:8327
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8327>

Matthew Woehlke skrev 2014-01-01 16:26:
> On 2013-12-31 21:05, fmatthew5876@gmail.com wrote:
>> On Tuesday, December 31, 2013 8:53:46 PM UTC-5, Billy O'Neal wrote:
>>> The other issue here is that "using std::swap" would require including
>>> <algorithm>...
>>
>> Implementing swap yourself in this way requires the same.
>
> I think the problem here is that the *header* would need to include it.
>
> Related to that note, I wonder if we should allow e.g.:
>
> foo.h
> -----
> class Foo
> {
>    ...
>    ~Foo();
>    ...
> }
>
> foo.cpp
> -------
>
> Foo::~Foo() = default;
>
>
> IOW, allow uses of '= default' after declaration, to allow the compiler
> to emit the default implementation at the source level rather than the
> header level. This would be great for classes where the default
> implementation would require a complete declaration of a type that
> otherwise could be forward declared. (Especially thinking of
> 'unique_ptr<Private>', for which the dtor needs the definition of
> Private, but otherwise Private could be forward declared.)
>
> In this case, this would solve needing <algorithm> in the header.
>

But wouldn't this instead cause trouble for <type_traits>, like 
is_trivially_destructible<Foo> ?


Bo Persson


-- 

--- 
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/.

.
