220 2760 <3aca8f41-7a21-40d8-9bf9-9c27dfa778f3@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional references -- take 2
Date: Wed, 6 Feb 2013 18:40:11 -0800 (PST)
Lines: 131
Approved: news@gmane.org
Message-ID: <3aca8f41-7a21-40d8-9bf9-9c27dfa778f3@isocpp.org>
References: <8d57e9e9-e4cc-441c-abeb-e6526531fad5@isocpp.org> <CAOHCbiuw0zezce9kcXVsEcE=mPmp=93zQHSRMzUcNw6u3TCsBQ@mail.gmail.com> <ca43f129-cd55-43d3-89fc-1e4402af0e9f@isocpp.org>
 <3534ECE0-D67E-443E-9593-76B644FDDF6A@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1130_27364047.1360204811794"
X-Trace: ger.gmane.org 1360204815 27516 80.91.229.3 (7 Feb 2013 02:40:15 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 7 Feb 2013 02:40:15 +0000 (UTC)
Cc: =?UTF-8?Q?Andrzej_Krzemie=C5=84ski?= <akrzemi1@gmail.com>, 
	Sean Parent <sean_parent@mac.com>, sean.parent@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBDNIZSEAKGQERX4TXMI@isocpp.org Thu Feb 07 03:40:34 2013
Return-path: <std-proposals+bncBCEKFTV6ZUMBBDNIZSEAKGQERX4TXMI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vb0-f69.google.com ([209.85.212.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBDNIZSEAKGQERX4TXMI@isocpp.org>)
	id 1U3HPc-0007zL-O9
	for gclcip-std-proposals@m.gmane.org; Thu, 07 Feb 2013 03:40:33 +0100
Original-Received: by mail-vb0-f69.google.com with SMTP id ff20sf2677750vbb.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 06 Feb 2013 18:40:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:date:from:to:cc:message-id
         :in-reply-to:references:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=EFMjMPtWRwdbvRlWu44F36s5MvV04E1AnK5xKrA6Hxs=;
        b=g/CD/XrXOQTLgKppiEuvEIJnzlMfP2RZYZxgxlUN6EI4C73YpqZ5yb9JCje4KeqDaj
         /vreDcs7afbcr+MqoS6suSk5mOrn1dFeWCsmx0dzKdrZYFjMuLFYOjzlNkCdrc5f/k/X
         B8vbLN2zHpF9ZVH8+G4+/UAmX3wZmOZcZsCVgOTbeBjx+mWGC6twHRNofccQ/7EGq4lV
         Q2F/CBUocTKvjjqvR04vQ5JWs+cb8OUwnDMx3X3sSeDMjOCMvyQZSusxyYOzGZJzi1+D
         qQJVOTohtJf7djOn/CcO3Fd5R+m61NyaOfwFyOngHJBzCATUo/uInUpxfxlxQ3l5qxcG
         V0Uw==
X-Received: by 10.236.134.43 with SMTP id r31mr13832991yhi.6.1360204813529;
        Wed, 06 Feb 2013 18:40:13 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.37.134 with SMTP id y6ls565161qej.96.gmail; Wed, 06 Feb
 2013 18:40:12 -0800 (PST)
X-Received: by 10.49.35.77 with SMTP id f13mr2694717qej.4.1360204812357;
        Wed, 06 Feb 2013 18:40:12 -0800 (PST)
In-Reply-To: <3534ECE0-D67E-443E-9593-76B644FDDF6A@gmail.com>
X-Original-Sender: jmckesson@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?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:2760
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2760>

------=_Part_1130_27364047.1360204811794
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Wednesday, February 6, 2013 6:11:37 PM UTC-8, Sean Parent wrote:
>
>
>
> Sent from my iPad
>
> On Feb 5, 2013, at 12:02 PM, Andrzej Krzemie=C5=84ski <akrz...@gmail.com<=
javascript:>>=20
> wrote:
>
>
> > mixed assignment is illegal. Use one of the following instead:=20
>> >=20
>> > *oi =3D j; // if you want to alter the referred-to object=20
>> > oi =3D {j}; // if you want to rebind a reference=20
>> >=20
>> >>=20
>> >=20
>> > Copy constructor and copy assignment are shallow: they only (re)bind a=
=20
>> > reference. Other operations are deep: this includes comparison (mixed=
=20
>> or=20
>> > homogenous)=20
>> >=20
>>
>> Is optional<T&> a RegularType?=20
>>
>
> I am not sure how to answer the question. Different people have slightly=
=20
> different expectations of a regular type.
> optional<T&> has:
>
>    - default ctor
>    - destructor
>    - copy/move constructor (shallow)
>    - copy/move assignment (shallow)
>    - equality comparison (deep, provided that T is comparable)
>
> Then the answer would be no. The semantics of regular types are well=20
> defined. See http://www.stepanovpapers.com/DeSt98.pdf. Copies must be=20
> equal and disjoint. These semantics are not regular. I find it odd that=
=20
> copying would behave differently than a T& and I'm not sure what this=20
> construct buys you over a T*.
>

That's really the question I have about this whole `optional<T&>` thing:=20
what exactly is the use case for this functionality that `T*` can't also=20
cover?

--=20

---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.



------=_Part_1130_27364047.1360204811794
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>On Wednesday, February 6, 2013 6:11:37 PM UTC-8, Sean Parent wrote:=
<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bor=
der-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"auto"><div><br><br=
>Sent from my iPad</div><div><br>On Feb 5, 2013, at 12:02 PM, Andrzej Krzem=
ie=C5=84ski &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-ma=
ilto=3D"BVmrMgkz5PwJ">akrz...@gmail.com</a>&gt; wrote:<br><br></div><blockq=
uote type=3D"cite"><div><br><blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; mi=
xed assignment is illegal. Use one of the following instead:
<br>&gt;
<br>&gt; *oi =3D j; // if you want to alter the referred-to object
<br>&gt; oi =3D {j}; // if you want to rebind a reference
<br>&gt;
<br>&gt;&gt;
<br>&gt;
<br>&gt; Copy constructor and copy assignment are shallow: they only (re)bi=
nd a
<br>&gt; reference. Other operations are deep: this includes comparison (mi=
xed or
<br>&gt; homogenous)
<br>&gt;
<br>
<br>Is optional&lt;T&amp;&gt; a RegularType?
<br></blockquote><div><br>I am not sure how to answer the question. Differe=
nt people have slightly different expectations of a regular type.<br>option=
al&lt;T&amp;&gt; has:<br><ul><li>default ctor</li><li>destructor<br></li><l=
i>copy/move constructor (shallow)</li><li>copy/move assignment (shallow)</l=
i><li>equality comparison (deep, provided that T is comparable)</li></ul></=
div></div></blockquote><div>Then the answer would be no. The semantics of r=
egular types are well defined. See&nbsp;<a href=3D"http://www.stepanovpaper=
s.com/DeSt98.pdf" target=3D"_blank">http://www.stepanovpapers.<wbr>com/DeSt=
98.pdf</a>.&nbsp;Copies must be equal and disjoint. These semantics are not=
 regular. I find it odd that copying would behave differently than a T&amp;=
 and I'm not sure what this construct buys you over a T*.</div></div></bloc=
kquote><div><br>That's really the question I have about this whole `optiona=
l&lt;T&amp;&gt;` thing: what exactly is the use case for this functionality=
 that `T*` can't also cover?</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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_1130_27364047.1360204811794--

.
