220 2741 <ca43f129-cd55-43d3-89fc-1e4402af0e9f@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: =?UTF-8?Q?Andrzej_Krzemie=C5=84ski?= <akrzemi1@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional references -- take 2
Date: Tue, 5 Feb 2013 12:02:42 -0800 (PST)
Lines: 98
Approved: news@gmane.org
Message-ID: <ca43f129-cd55-43d3-89fc-1e4402af0e9f@isocpp.org>
References: <8d57e9e9-e4cc-441c-abeb-e6526531fad5@isocpp.org>
 <CAOHCbiuw0zezce9kcXVsEcE=mPmp=93zQHSRMzUcNw6u3TCsBQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1772_14843462.1360094562219"
X-Trace: ger.gmane.org 1360094563 4921 80.91.229.3 (5 Feb 2013 20:02:43 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 5 Feb 2013 20:02:43 +0000 (UTC)
Cc: Sean Parent <sean_parent@mac.com>
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDT2DGOJ34DBBY6KYWEAKGQE46XBNVI@isocpp.org Tue Feb 05 21:03:03 2013
Return-path: <std-proposals+bncBDT2DGOJ34DBBY6KYWEAKGQE46XBNVI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qe0-f70.google.com ([209.85.128.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDT2DGOJ34DBBY6KYWEAKGQE46XBNVI@isocpp.org>)
	id 1U2ojO-0001h0-D4
	for gclcip-std-proposals@m.gmane.org; Tue, 05 Feb 2013 21:03:02 +0100
Original-Received: by mail-qe0-f70.google.com with SMTP id 1sf850063qec.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 05 Feb 2013 12:02:43 -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=jVqOylWGUp9DL/I3qkQdRkrBZBpxMHnn4t2hePoryo0=;
        b=wynjKM2MHmJFxZMy8OCT4Ge0VEQErHIFzqxBm9SvG4F3HJqpyGJZff9pJx+ydSFNih
         nnHYI9KCToHWxfqpW6VPKAnZRuq9zv+H8zgigNFbxcyhvp5tTAn1pYvTPAoALxIWHZlh
         C1M8B1UH67aF3s9A4Qv6Z9/n7GXtyNkZQCqJjJpckxROrK39ORA4WIWNetWueI2si1Rv
         vhfEk0obff6Z5SVY9dnC1nLQPAVdBeoluYb9gZOsATV6/rjjZL/gcKy3AnmUljqW4JBE
         GIvfUUcTW3EZIkbRSlwQaRZXPTgd10meLUWxn2XP6Xty/5aZPKXlPIHeBRUuKwVyStzK
         v23A==
X-Received: by 10.224.72.199 with SMTP id n7mr13890127qaj.5.1360094563270;
        Tue, 05 Feb 2013 12:02:43 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.11.204 with SMTP id s12ls128158qeb.11.gmail; Tue, 05 Feb
 2013 12:02:42 -0800 (PST)
X-Received: by 10.49.116.135 with SMTP id jw7mr2249961qeb.10.1360094562884;
        Tue, 05 Feb 2013 12:02:42 -0800 (PST)
In-Reply-To: <CAOHCbiuw0zezce9kcXVsEcE=mPmp=93zQHSRMzUcNw6u3TCsBQ@mail.gmail.com>
X-Original-Sender: akrzemi1@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:2741
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2741>

------=_Part_1772_14843462.1360094562219
Content-Type: text/plain; charset=ISO-8859-1



> > mixed assignment is illegal. Use one of the following instead: 
> > 
> > *oi = j; // if you want to alter the referred-to object 
> > oi = {j}; // if you want to rebind a reference 
> > 
> >> 
> > 
> > Copy constructor and copy assignment are shallow: they only (re)bind a 
> > reference. Other operations are deep: this includes comparison (mixed or 
> > homogenous) 
> > 
>
> Is optional<T&> a RegularType? 
>

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)
   - it is not swappable yet, but I intend to add a shallow swap
   
I am not not sure what semantic requirements a RegularType requires. The 
value compared by operator== is not under control of the optional object: 
it can change "asynchronously". Also the copy/move operations are not 
compatible with operator==: the former are shallow, the latter is deep.
 

-- 

--- 
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/?hl=en.



------=_Part_1772_14843462.1360094562219
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;">&gt; mixed assignment is i=
llegal. 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><li>it =
is not swappable yet, but I intend to add a shallow swap<br></li></ul>I am =
not not sure what semantic requirements a RegularType requires. The value c=
ompared by operator=3D=3D is not under control of the optional object: it c=
an change "asynchronously". Also the copy/move operations are not compatibl=
e with operator=3D=3D: the former are shallow, the latter is deep.<br></div=
><div>&nbsp;</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_1772_14843462.1360094562219--

.
