220 8342 <CAOU91ON8V+jqw4WeTNfZTXTZWMf4mpM5G7zpDDNE7Hn9OjqEJQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Proposal: Default swap operation
Date: Thu, 2 Jan 2014 01:26:09 +0100
Lines: 97
Approved: news@gmane.org
Message-ID: <CAOU91ON8V+jqw4WeTNfZTXTZWMf4mpM5G7zpDDNE7Hn9OjqEJQ@mail.gmail.com>
References: <c505e517-1c73-4486-b9dd-9ec15af1e649@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c2903c10f1c304eef1d7f8
X-Trace: ger.gmane.org 1388622365 3601 80.91.229.3 (2 Jan 2014 00:26:05 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 2 Jan 2014 00:26:05 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD3NR2WQQ4IBBIXESKLAKGQEXCVY2NY@isocpp.org Thu Jan 02 01:26:13 2014
Return-path: <std-proposals+bncBD3NR2WQQ4IBBIXESKLAKGQEXCVY2NY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f199.google.com ([209.85.214.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD3NR2WQQ4IBBIXESKLAKGQEXCVY2NY@isocpp.org>)
	id 1VyW71-0007fc-To
	for gclcip-std-proposals@m.gmane.org; Thu, 02 Jan 2014 01:26:12 +0100
Original-Received: by mail-ob0-f199.google.com with SMTP id gq1sf65930250obb.6
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Jan 2014 16:26:11 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from: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=zJ5JG2w/o+IVdvvgvDw/e+fppoX07OWEbLiwz9VFp1E=;
        b=Z/nKtwPClKdU/sQohgct8EkhNOwwOeHilEdT4Ut0dTa028Phe/oWjWnZYVDwJI8F8W
         cvQ0Sy8cbpWipZC9ELp5wNKLT3JNeplGq/xh5ROhkw4m5TZWLskd+uNmWFkZ3idEmzUJ
         Hpo+LGherBhgeG38NYyMO6kZdUeLrjhiDX77nxu/h4+hMJECdJ64d0nrmM751pXWvA5T
         PcubOEPoEQsnrazns8g00fnOJyWdBCxGC/f/lOVw875Jn2Itc8OmT/I54vZK2z1QgubC
         EpYgs2v9FozJR0QTfMLMmMTNKJ+8EaGGBzoIMON15N1lFg5wUY0bE89vOuPE9cwAnAey
         kWqA==
X-Gm-Message-State: ALoCoQkEvslRXCR1v52O7+UJhxmJbsgBbVZVExG3tOe8EvcR70/Iyl2p/yIsJOrST4rlJSyPW4bq
X-Received: by 10.43.100.129 with SMTP id cw1mr1467191icc.30.1388622370986;
        Wed, 01 Jan 2014 16:26:10 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.59.49 with SMTP id w17ls4428385qeq.68.gmail; Wed, 01 Jan
 2014 16:26:10 -0800 (PST)
X-Received: by 10.229.102.4 with SMTP id e4mr131964282qco.2.1388622370070;
        Wed, 01 Jan 2014 16:26:10 -0800 (PST)
Original-Received: from mail-ob0-x22b.google.com (mail-ob0-x22b.google.com [2607:f8b0:4003:c01::22b])
        by mx.google.com with ESMTPS id r7si51157511qar.19.2014.01.01.16.26.10
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 01 Jan 2014 16:26:10 -0800 (PST)
Received-SPF: pass (google.com: domain of mjklaim@gmail.com designates 2607:f8b0:4003:c01::22b as permitted sender) client-ip=2607:f8b0:4003:c01::22b;
Original-Received: by mail-ob0-f171.google.com with SMTP id wp18so13915530obc.16
        for <std-proposals@isocpp.org>; Wed, 01 Jan 2014 16:26:09 -0800 (PST)
X-Received: by 10.182.28.134 with SMTP id b6mr53319304obh.27.1388622369581;
 Wed, 01 Jan 2014 16:26:09 -0800 (PST)
Original-Received: by 10.76.20.142 with HTTP; Wed, 1 Jan 2014 16:26:09 -0800 (PST)
In-Reply-To: <c505e517-1c73-4486-b9dd-9ec15af1e649@isocpp.org>
X-Original-Sender: mjklaim@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of mjklaim@gmail.com designates 2607:f8b0:4003:c01::22b as permitted
 sender) smtp.mail=mjklaim@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:8342
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8342>

--001a11c2903c10f1c304eef1d7f8
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Jan 1, 2014 at 2:42 AM, <fmatthew5876@gmail.com> wrote:

> Writing swap() is one of those boilerplate kinds of things that is usually
> trivial but annoying (and error prone when you change data members but
> forget to update swap()).
>
> Why not allow this:
>
> class Foo {
>   public:
>     void swap(Foo& f) = default;
>   private:
>     int a;
>     Bar b;
>     float c;
>     Baz* d;
> };
>
> Which would be the equivalent of this:
>
> void Foo::swap(Foo& f) {
>   using std::swap;
>   swap(a, f.a);
>   swap(b, f.b);
>   swap(c, f.c);
>   swap(d, f.d);
> }
>
> Any reason this wouldn't make it as a proposal?
>

How would this differ from the swap operator proposal? [1]
I don't remember if a discussion about this paper happened around here or
if someone talked about how it was received by the committee.


[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3746.pdf

-- 

--- 
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/.

--001a11c2903c10f1c304eef1d7f8
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Wed, Jan 1, 2014 at 2:42 AM,  <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:fmatthew5876@gmail.com" target=3D"_blank">fmatthew5876@gmail.com</a>&=
gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr">Writing swap() is one of those boilerplat=
e kinds of things that is usually trivial but annoying (and error prone whe=
n you change data members but forget to update swap()).<div>
<br></div><div>Why not allow this:</div><div><br></div><div>class Foo {</di=
v><div>=A0 public:</div><div>=A0 =A0 void swap(Foo&amp; f) =3D default;</di=
v><div>=A0 private:</div><div>=A0 =A0 int a;</div><div>=A0 =A0 Bar b;</div>=
<div>=A0 =A0 float c;</div>
<div>=A0 =A0 Baz* d;</div><div>};</div><div><br></div><div>Which would be t=
he equivalent of this:</div><div><br></div><div>void Foo::swap(Foo&amp; f) =
{<br>=A0 using std::swap;</div><div>=A0 swap(a, f.a);</div><div>=A0 swap(b,=
 f.b);</div>
<div>=A0 swap(c, f.c);</div><div>=A0 swap(d, f.d);</div><div>}</div><div><b=
r></div><div>Any reason this wouldn&#39;t make it as a proposal?</div></div=
></blockquote><div><br></div><div>How would this differ from the swap opera=
tor proposal? [1]</div>
<div>I don&#39;t remember if a discussion about this paper happened around =
here or if someone talked about how it was received by the committee.</div>=
<div><br></div><div><br></div><div>[1] <a href=3D"http://www.open-std.org/j=
tc1/sc22/wg21/docs/papers/2013/n3746.pdf">http://www.open-std.org/jtc1/sc22=
/wg21/docs/papers/2013/n3746.pdf</a></div>
</div></div></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c2903c10f1c304eef1d7f8--

.
