220 8325 <52C4339B.20701@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 10:26:19 -0500
Lines: 47
Approved: news@gmane.org
Message-ID: <52C4339B.20701@gmail.com>
References: <c505e517-1c73-4486-b9dd-9ec15af1e649@isocpp.org> <CAPBZbvxzF1pgzaa=A5KfWDTeX7o0epwWiH5+YES+7u4eX2SG0Q@mail.gmail.com> <68012381-8af4-4d62-a5a4-912c454fba96@isocpp.org>
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 1388589977 19951 80.91.229.3 (1 Jan 2014 15:26:17 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 1 Jan 2014 15:26:17 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBBHPHSCLAKGQEXUOXNNY@isocpp.org Wed Jan 01 16:26:23 2014
Return-path: <std-proposals+bncBC37LBFWUIFBBHPHSCLAKGQEXUOXNNY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f200.google.com ([209.85.214.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBHPHSCLAKGQEXUOXNNY@isocpp.org>)
	id 1VyNgc-0006ZN-Uq
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Jan 2014 16:26:23 +0100
Original-Received: by mail-ob0-f200.google.com with SMTP id wm4sf64445434obc.11
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Jan 2014 07:26:22 -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=X5Yq1/aPt+PvvAccTUp2VFcXRZULJ9b7tHhSQzman6Q=;
        b=WK80LVgwM4syE4ryCC3Dp6T37mlpkSu44bGDVinU8atZNK4BMutLnyJNGI8GMm/KRd
         7SpNyPeffZ5CZGEduQxDNzU5edw1hRCOSHAijI19nxco7NiE0qD2qU/IJRj0VWpyfKbb
         ySKBy8WC8T4OwpS7eAp183+XSleDG6UwbZqOrx+tuyDe2Bwkki2D67e9ZDwbM0CymWiu
         MiZFzVLje6YJD9VVc9uzrqzMAugjxCCxDrhhLiRdmvOMcVomV4BHkBkNbEXe6A8Gf1mE
         XDlPDUvcsCfOYgpTcULDR2Du9E0UmMFzhkXvfTxsurhvLAtTVl9nr/6P3bKqgVIffSfl
         yIQQ==
X-Gm-Message-State: ALoCoQkCKlrWiU+jPFd1EoWS9eZmaC+hHoE47ezLI2mnU0fiQmA3Fj0eaVXD00cvQ2T40bqik0jv
X-Received: by 10.182.19.164 with SMTP id g4mr31021349obe.21.1388589981966;
        Wed, 01 Jan 2014 07:26:21 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.47.9 with SMTP id z9ls4212834qem.79.gmail; Wed, 01 Jan 2014
 07:26:21 -0800 (PST)
X-Received: by 10.224.103.68 with SMTP id j4mr19462814qao.95.1388589981195;
        Wed, 01 Jan 2014 07:26:21 -0800 (PST)
Original-Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [2607:f8b0:4001:c05::22d])
        by mx.google.com with ESMTPS id o8si22267291qcj.66.2014.01.01.07.26.21
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 01 Jan 2014 07:26:21 -0800 (PST)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 2607:f8b0:4001:c05::22d as permitted sender) client-ip=2607:f8b0:4001:c05::22d;
Original-Received: by mail-ig0-f173.google.com with SMTP id ut6so841656igb.0
        for <std-proposals@isocpp.org>; Wed, 01 Jan 2014 07:26:20 -0800 (PST)
X-Received: by 10.42.113.137 with SMTP id c9mr310088icq.90.1388589980768;
        Wed, 01 Jan 2014 07:26:20 -0800 (PST)
Original-Received: from [192.168.1.181] (tripoint.kitware.com. [66.194.253.20])
        by mx.google.com with ESMTPSA id kt2sm69592989igb.1.2014.01.01.07.26.19
        for <multiple recipients>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 01 Jan 2014 07:26:20 -0800 (PST)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
In-Reply-To: <68012381-8af4-4d62-a5a4-912c454fba96@isocpp.org>
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::22d 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:8325
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8325>

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.

-- 
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/.

.
