220 14095 <CALDL7dFc5bk3BzvFRcatOVTv3Y4R_sAP8wsOJg2OY7osg3fgqA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Farid Mehrabi <farid.mehrabi@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Reconstruct function idea
Date: Tue, 21 Oct 2014 22:24:01 +0330
Lines: 117
Approved: news@gmane.org
Message-ID: <CALDL7dFc5bk3BzvFRcatOVTv3Y4R_sAP8wsOJg2OY7osg3fgqA@mail.gmail.com>
References: <ff612334-ae16-43d1-a650-580d0ce635f2@isocpp.org>
 <97aba3ad-71d1-46ef-88e5-ee00137df7fb@isocpp.org> <CAOfiQqkXfdp4mfXUR0pO5YpQ=bnNPzThAEmY_+um32H2oSS9=w@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c3a16af740060505f35b07
X-Trace: ger.gmane.org 1413917668 28496 80.91.229.3 (21 Oct 2014 18:54:28 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 21 Oct 2014 18:54:28 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC27JR6ERAOBBXWXTKRAKGQEBQLFPHY@isocpp.org Tue Oct 21 20:54:23 2014
Return-path: <std-proposals+bncBC27JR6ERAOBBXWXTKRAKGQEBQLFPHY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ee0-f69.google.com ([74.125.83.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC27JR6ERAOBBXWXTKRAKGQEBQLFPHY@isocpp.org>)
	id 1XgeZb-0003Vy-6g
	for gclcip-std-proposals@m.gmane.org; Tue, 21 Oct 2014 20:54:23 +0200
Original-Received: by mail-ee0-f69.google.com with SMTP id b57sf760572eek.8
        for <gclcip-std-proposals@m.gmane.org>; Tue, 21 Oct 2014 11:54:22 -0700 (PDT)
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:from:date
         :message-id:subject: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=ciqeZ5Qr33kdUrLgG0MTpz3Uf/6m07FtAnPvuBl0lmg=;
        b=Ie9uWOOsUU9NwZKtU/g19aK1gS+BbXnMLc0zMB3V2EQ/sSqRDtQZtUrT95gmIQNnxK
         mOVF4vfx6vtMDKaRnS69O9YA/pobP5zTSdz08ZFlun8lsV8LGgN8OFvCodnblmCkiTUJ
         trOqSDeGhdN59/7yegQf299az9r0hbI1fR17iFInmVRRv6dIi/jqiN5ulujg7pQSwVYO
         OWFUfAtq0P0sBKsL2f+5RglC+DgmJE2bC5xV+yIWpb+b3ELdQsTkpigvCGMET3vgjH8W
         HUUgTYe3VsWiVsLLsuUeazSVjsLGuGsxdgQEeBBb6qkKNBuJDpYOBpI+5OcsVCnIHgOt
         dl1A==
X-Gm-Message-State: ALoCoQleeNS7o4G2KH9FXF4RifOIbh8PD+yP5YG9G97uKKaBDA8iz0B92seLubF7nTA5BmExoNaZ
X-Received: by 10.180.76.42 with SMTP id h10mr21348wiw.6.1413917662870;
        Tue, 21 Oct 2014 11:54:22 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.93.132 with SMTP id cu4ls163355wib.2.gmail; Tue, 21 Oct
 2014 11:54:21 -0700 (PDT)
X-Received: by 10.180.21.163 with SMTP id w3mr97578wie.66.1413917661964;
        Tue, 21 Oct 2014 11:54:21 -0700 (PDT)
Original-Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com. [2a00:1450:400c:c05::22a])
        by mx.google.com with ESMTPS id wi7si15880336wjb.150.2014.10.21.11.54.21
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 21 Oct 2014 11:54:21 -0700 (PDT)
Received-SPF: pass (google.com: domain of farid.mehrabi@gmail.com designates 2a00:1450:400c:c05::22a as permitted sender) client-ip=2a00:1450:400c:c05::22a;
Original-Received: by mail-wi0-f170.google.com with SMTP id hi2so11852599wib.1
        for <std-proposals@isocpp.org>; Tue, 21 Oct 2014 11:54:21 -0700 (PDT)
X-Received: by 10.180.207.77 with SMTP id lu13mr205560wic.12.1413917661673;
 Tue, 21 Oct 2014 11:54:21 -0700 (PDT)
Original-Received: by 10.217.41.5 with HTTP; Tue, 21 Oct 2014 11:54:01 -0700 (PDT)
In-Reply-To: <CAOfiQqkXfdp4mfXUR0pO5YpQ=bnNPzThAEmY_+um32H2oSS9=w@mail.gmail.com>
X-Original-Sender: farid.mehrabi@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of farid.mehrabi@gmail.com designates 2a00:1450:400c:c05::22a as
 permitted sender) smtp.mail=farid.mehrabi@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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:14095
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14095>

--001a11c3a16af740060505f35b07
Content-Type: text/plain; charset=UTF-8

2014-10-16 23:46 GMT+03:30 Richard Smith <richard@metafoo.co.uk>:

> On Wed, Oct 15, 2014 at 11:40 PM, Markus Grech <markus.grech@gmail.com>
> wrote:
>
>> I'm very surprised that nobody here knows how to write copy&swap
>> correctly.
>> T& operator =(T rhs)
>> {
>>     swap(rhs);
>>     return *this;
>> }
>>
>
>
> http://stackoverflow.com/questions/7458110/c-unified-assignment-operator-move-semantics/7458222#7458222
>
> http://stackoverflow.com/questions/18303287/when-is-overloading-pass-by-reference-l-value-and-r-value-preferred-to-pass-by/18303787#18303787
>

what is the point in that link? why so much verbosity?
simpler code is easier to maintain and Markus`s code generates optimal code
for most cases(assuming improbability of self assignment).

regards,
FM.


-- 
how am I supposed to end the twisted road of  your hair in the dark night??
unless the candle of your face does turn a lamp up on my way!!!

-- 

--- 
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/.

--001a11c3a16af740060505f35b07
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"rtl"><div dir=3D"ltr"><br></div><div class=3D"gmail_extra"><div=
 dir=3D"ltr"><br><div class=3D"gmail_quote">2014-10-16 23:46 GMT+03:30 Rich=
ard Smith <span dir=3D"ltr">&lt;<a href=3D"mailto:richard@metafoo.co.uk" ta=
rget=3D"_blank">richard@metafoo.co.uk</a>&gt;</span>:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;bo=
rder-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">=
<div class=3D"gmail_extra"><div class=3D"gmail_quote"><span class=3D"">On W=
ed, Oct 15, 2014 at 11:40 PM, Markus Grech <span dir=3D"ltr">&lt;<a href=3D=
"mailto:markus.grech@gmail.com" target=3D"_blank">markus.grech@gmail.com</a=
>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);bo=
rder-left-style:solid;padding-left:1ex"><div dir=3D"ltr">I&#39;m very surpr=
ised that nobody here knows how to write copy&amp;swap correctly.<div><div =
style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;background-=
color:rgb(250,250,250)"><code><div><font color=3D"#660066"><span style=3D"c=
olor:rgb(0,0,0)">T</span><span style=3D"color:rgb(102,102,0)">&amp;</span><=
span style=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(0,0,136)">=
operator</span><span style=3D"color:rgb(0,0,0)"> </span><span style=3D"colo=
r:rgb(102,102,0)">=3D(</span><span style=3D"color:rgb(0,0,0)">T rhs</span><=
span style=3D"color:rgb(102,102,0)">)</span><span style=3D"color:rgb(0,0,0)=
"><br></span><span style=3D"color:rgb(102,102,0)">{</span><span style=3D"co=
lor:rgb(0,0,0)"><br>=C2=A0 =C2=A0 swap</span><span style=3D"color:rgb(102,1=
02,0)">(</span><span style=3D"color:rgb(0,0,0)">rhs</span><span style=3D"co=
lor:rgb(102,102,0)">);</span><span style=3D"color:rgb(0,0,0)"><br></span></=
font><span style=3D"color:rgb(0,0,0)"><span style=3D"color:rgb(0,0,0)">=C2=
=A0 =C2=A0 </span><span style=3D"color:rgb(0,0,136)">return</span><span sty=
le=3D"color:rgb(0,0,0)"> </span><span style=3D"color:rgb(102,102,0)">*</spa=
n><span style=3D"color:rgb(0,0,136)">this</span><span style=3D"color:rgb(10=
2,102,0)">;</span></span><font color=3D"#660066"><span style=3D"color:rgb(0=
,0,0)"><br></span><span style=3D"color:rgb(102,102,0)">}</span></font></div=
></code></div></div></div></blockquote><div><br></div></span><div><a href=
=3D"http://stackoverflow.com/questions/7458110/c-unified-assignment-operato=
r-move-semantics/7458222#7458222" target=3D"_blank">http://stackoverflow.co=
m/questions/7458110/c-unified-assignment-operator-move-semantics/7458222#74=
58222</a><br></div><div><a href=3D"http://stackoverflow.com/questions/18303=
287/when-is-overloading-pass-by-reference-l-value-and-r-value-preferred-to-=
pass-by/18303787#18303787" target=3D"_blank">http://stackoverflow.com/quest=
ions/18303287/when-is-overloading-pass-by-reference-l-value-and-r-value-pre=
ferred-to-pass-by/18303787#18303787</a></div></div></div></blockquote></div=
><div class=3D""><div class=3D"h5">

<p></p></div></div></div><div><br></div><div dir=3D"ltr">what is the point =
in that link? why so much verbosity?</div><div dir=3D"ltr">simpler code is =
easier to=C2=A0<span style=3D"font-family:arial,sans-serif;font-size:13px">=
maintain and=C2=A0</span>Markus`s code generates optimal code for most case=
s(assuming improbability of self assignment).</div><div dir=3D"ltr"><br></d=
iv><div dir=3D"ltr">regards,</div><div dir=3D"ltr">FM.</div><div dir=3D"ltr=
"><br></div><div dir=3D"ltr">=C2=A0</div>-- <br><div dir=3D"ltr">how am I s=
upposed to end the twisted road of=C2=A0 your hair in the dark night??<br>u=
nless the candle of your face does turn a lamp up on my way!!!<br></div>
</div></div>

<p></p>

-- <br />
<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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<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 />

--001a11c3a16af740060505f35b07--

.
