220 2759 <3534ECE0-D67E-443E-9593-76B644FDDF6A@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Sean Parent <sean.parent@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional references -- take 2
Date: Wed, 6 Feb 2013 18:11:37 -0800
Lines: 128
Approved: news@gmane.org
Message-ID: <3534ECE0-D67E-443E-9593-76B644FDDF6A@gmail.com>
References: <8d57e9e9-e4cc-441c-abeb-e6526531fad5@isocpp.org> <CAOHCbiuw0zezce9kcXVsEcE=mPmp=93zQHSRMzUcNw6u3TCsBQ@mail.gmail.com> <ca43f129-cd55-43d3-89fc-1e4402af0e9f@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (1.0)
Content-Type: multipart/alternative;
	boundary=Apple-Mail-F27E2A10-94FA-48C8-910C-9DA717F1FC76
Content-Transfer-Encoding: 7bit
X-Trace: ger.gmane.org 1360203101 15020 80.91.229.3 (7 Feb 2013 02:11:41 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 7 Feb 2013 02:11:41 +0000 (UTC)
Cc: "std-proposals@isocpp.org" <std-proposals@isocpp.org>,
 Sean Parent <sean_parent@mac.com>
To: =?utf-8?Q?Andrzej_Krzemie=C5=84ski?= <akrzemi1@gmail.com>
Original-X-From: std-proposals+bncBCQZJ4VEWEPRBXE2ZSEAKGQE3XHYRSQ@isocpp.org Thu Feb 07 03:12:01 2013
Return-path: <std-proposals+bncBCQZJ4VEWEPRBXE2ZSEAKGQE3XHYRSQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f198.google.com ([209.85.214.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCQZJ4VEWEPRBXE2ZSEAKGQE3XHYRSQ@isocpp.org>)
	id 1U3Gy0-0003rt-O0
	for gclcip-std-proposals@m.gmane.org; Thu, 07 Feb 2013 03:12:01 +0100
Original-Received: by mail-ob0-f198.google.com with SMTP id dn14sf9783577obc.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 06 Feb 2013 18:11:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:x-received:received-spf
         :x-received:references:mime-version:in-reply-to:message-id:cc
         :x-mailer:from:subject:date:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type
         :content-transfer-encoding;
        bh=4Y6cdSgtnIrUzKUZBitZc21C5ngIHdZyHdDY5lIBrT8=;
        b=XtNTvygzJg7g7Vs8UeiP1h8JuH94IyCbZxfJAcQm4da4QPn/NE9ucwEwF9u8Vrf4p+
         6n2EKb9qNKGZtnvgX6FxGC5qJkZdz3hAimF/eRvhIZ8Ak3IqeSf9sD4TYsIYKudvx+7O
         wVDiitVS4el2RHmhROH9bbc1RiwvnczEV6AP6WzlkTfhN4XLtt5hu+KRXRZJ5d9zBV6M
         Hbm2ELqPFJub/KSJYHGEDLBn6VTISfr6EZKMbdz9g989NXBO/zlEy52TRBd6Gwu0KZGj
         6 
X-Received: by 10.42.159.65 with SMTP id k1mr23311650icx.10.1360203101085;
        Wed, 06 Feb 2013 18:11:41 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.5.175 with SMTP id t15ls2963447igt.33.canary; Wed, 06 Feb
 2013 18:11:39 -0800 (PST)
X-Received: by 10.50.33.233 with SMTP id u9mr10893467igi.39.1360203099626;
        Wed, 06 Feb 2013 18:11:39 -0800 (PST)
X-Received: by 10.50.33.233 with SMTP id u9mr10893464igi.39.1360203099585;
        Wed, 06 Feb 2013 18:11:39 -0800 (PST)
Original-Received: from mail-ia0-x234.google.com (mail-ia0-x234.google.com [2607:f8b0:4001:c02::234])
        by mx.google.com with ESMTPS id j15si5093615iga.42.2013.02.06.18.11.39
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 06 Feb 2013 18:11:39 -0800 (PST)
Received-SPF: pass (google.com: domain of sean.parent@gmail.com designates 2607:f8b0:4001:c02::234 as permitted sender) client-ip=2607:f8b0:4001:c02::234;
Original-Received: by mail-ia0-f180.google.com with SMTP id f27so2388780iae.39
        for <std-proposals@isocpp.org>; Wed, 06 Feb 2013 18:11:39 -0800 (PST)
X-Received: by 10.50.151.225 with SMTP id ut1mr10664520igb.110.1360203099256;
        Wed, 06 Feb 2013 18:11:39 -0800 (PST)
Original-Received: from [172.16.222.117] ([66.126.158.85])
        by mx.google.com with ESMTPS id ig8sm6905723igc.10.2013.02.06.18.11.37
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 06 Feb 2013 18:11:38 -0800 (PST)
In-Reply-To: <ca43f129-cd55-43d3-89fc-1e4402af0e9f@isocpp.org>
X-Mailer: iPad Mail (10B141)
X-Original-Sender: sean.parent@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of sean.parent@gmail.com designates 2607:f8b0:4001:c02::234 as
 permitted sender) smtp.mail=sean.parent@gmail.com;       dkim=pass header.i=@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:2759
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2759>

--Apple-Mail-F27E2A10-94FA-48C8-910C-9DA717F1FC76
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



Sent from my iPad

On Feb 5, 2013, at 12:02 PM, Andrzej Krzemie=C5=84ski <akrzemi1@gmail.com> =
wrote:

>=20
>> > 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 =
or=20
>> > homogenous)=20
>> >=20
>>=20
>> Is optional<T&> a RegularType?
>=20
> I am not sure how to answer the question. Different people have slightly =
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 define=
d. See http://www.stepanovpapers.com/DeSt98.pdf. Copies must be equal and d=
isjoint. These semantics are not regular. I find it odd that copying would =
behave differently than a T& and I'm not sure what this construct buys you =
over a T*.

> it is not swappable yet, but I intend to add a shallow swap
Given that it is copyable and assignable how is it not swappable?

> I am not not sure what semantic requirements a RegularType requires. The =
value compared by operator=3D=3D is not under control of the optional objec=
t: it can change "asynchronously". Also the copy/move operations are not co=
mpatible with operator=3D=3D: the former are shallow, the latter is deep.
> =20

--=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.



--Apple-Mail-F27E2A10-94FA-48C8-910C-9DA717F1FC76
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=
=3Dutf-8"></head><body dir=3D"auto"><div><br><br>Sent from my iPad</div><di=
v><br>On Feb 5, 2013, at 12:02 PM, Andrzej Krzemie=F1ski &lt;<a href=3D"mai=
lto:akrzemi1@gmail.com">akrzemi1@gmail.com</a>&gt; wrote:<br><br></div><blo=
ckquote type=3D"cite"><div><br><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
>&gt; mixed 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">http://www.stepanovpapers.com/DeSt98.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><br></div><blockquote type=3D"=
cite"><div><div><ul><li>it is not swappable yet, but I intend to add a shal=
low swap<br></li></ul></div></div></blockquote><div>Given that it is copyab=
le and assignable how is it not swappable?</div><br><blockquote type=3D"cit=
e"><div><div>I am not not sure what semantic requirements a RegularType req=
uires. The value compared by operator=3D=3D is not under control of the opt=
ional object: it can change "asynchronously". Also the copy/move operations=
 are not compatible with operator=3D=3D: the former are shallow, the latter=
 is deep.<br></div><div>&nbsp;</div>
</div></blockquote></body></html>

<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 />

--Apple-Mail-F27E2A10-94FA-48C8-910C-9DA717F1FC76--

.
