220 2749 <13f19963-066b-4170-a6f2-eb90bed29be1@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: Wed, 6 Feb 2013 02:08:26 -0800 (PST)
Lines: 520
Approved: news@gmane.org
Message-ID: <13f19963-066b-4170-a6f2-eb90bed29be1@isocpp.org>
References: <8d57e9e9-e4cc-441c-abeb-e6526531fad5@isocpp.org>
 <CAOHCbiuw0zezce9kcXVsEcE=mPmp=93zQHSRMzUcNw6u3TCsBQ@mail.gmail.com>
 <ca43f129-cd55-43d3-89fc-1e4402af0e9f@isocpp.org>
 <CAOHCbivkX3wbRi6dTAcpZ1EmbpOjx_h6VkCqN8KHT0mZ_UWUXQ@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_98_19665365.1360145306280"
X-Trace: ger.gmane.org 1360145309 10733 80.91.229.3 (6 Feb 2013 10:08:29 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 6 Feb 2013 10:08:29 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDT2DGOJ34DBBG6XZCEAKGQEKCQVKHA@isocpp.org Wed Feb 06 11:08:48 2013
Return-path: <std-proposals+bncBDT2DGOJ34DBBG6XZCEAKGQEKCQVKHA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ye0-f198.google.com ([209.85.213.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDT2DGOJ34DBBG6XZCEAKGQEKCQVKHA@isocpp.org>)
	id 1U31vq-0003Gu-V0
	for gclcip-std-proposals@m.gmane.org; Wed, 06 Feb 2013 11:08:47 +0100
Original-Received: by mail-ye0-f198.google.com with SMTP id l11sf1505797yen.5
        for <gclcip-std-proposals@m.gmane.org>; Wed, 06 Feb 2013 02:08:27 -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: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=wRF1y78vi3Mmrg3ssNOc6L5NPQ3K459CN8soIh29vAc=;
        b=fr863YwHnab9r91fnuxCuDwuxhHTeHObP/65jEYFM2Xwp+lULKjjlRFVzINsXVXWD0
         lpnrmoVkX9Vt3oNeWiu+bk7+aJyJxVV8VZBcHknKkcTlNUkqywxJD3CwMkWyJZ/Vd/wG
         0q9FiKQayDgMMWfG9KFW2qUPkFFPPJ5AT9ARVYAXJpONxaT0Fa9Puy3Ld7wY2GWelbQh
         JbLrQYZd6Ne+sTb+KOA3undlvGJJUnGW+FI3/cfBd08Sk0bLCWI5CmCeSJ1e+Mmd6xuM
         tSCROKRWc1X1I80II4fDRfxQvJNLWuBJeR0YbrrJxJ3QgLex4L7HMzhySLiEpaZPZWUh
         82AA==
X-Received: by 10.224.176.196 with SMTP id bf4mr9253347qab.4.1360145307666;
        Wed, 06 Feb 2013 02:08:27 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.74.234 with SMTP id x10ls294606qev.99.gmail; Wed, 06 Feb
 2013 02:08:27 -0800 (PST)
X-Received: by 10.49.116.1 with SMTP id js1mr2424806qeb.19.1360145307075;
        Wed, 06 Feb 2013 02:08:27 -0800 (PST)
In-Reply-To: <CAOHCbivkX3wbRi6dTAcpZ1EmbpOjx_h6VkCqN8KHT0mZ_UWUXQ@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:2749
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2749>

------=_Part_98_19665365.1360145306280
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable



W dniu wtorek, 5 lutego 2013 23:39:16 UTC+1 u=BFytkownik Tony V E napisa=B3=
:
>
> On Tue, Feb 5, 2013 at 3:02 PM, Andrzej Krzemie=F1ski <akrz...@gmail.com<=
javascript:>>=20
> wrote:=20
> >>=20
> >> Is optional<T&> a RegularType?=20
> >=20
> >=20
> > I am not sure how to answer the question. Different people have slightl=
y=20
> > different expectations of a regular type.=20
>
> That's why I cc'ed Sean Parent :-)=20
>
> Let's go with Stepanov, via http://www.stepanovpapers.com/DeSt98.pdf=20
> and Elements of Programming (www.elementsofprogramming.com)=20
>
> > optional<T&> has:=20
> >=20
> > default ctor=20
> > destructor=20
> > copy/move constructor (shallow)=20
> > copy/move assignment (shallow)=20
> > equality comparison (deep, provided that T is comparable)=20
> > it is not swappable yet, but I intend to add a shallow swap=20
> >=20
> > I am not not sure what semantic requirements a RegularType requires.=20
>
> To summarize Stepanov, mainly the semantics of int w.r.t. copy,=20
> assignment, and equality:=20
>
> T b =3D ...<any value of T>;=20
> T a =3D b;=20
> assert(a =3D=3D b);=20
>

This holds, but -- so to say -- only by chance=20

>
> T c =3D b;=20
> change(a);=20
> assert(c =3D=3D b && a !=3D b);=20
>
=20
Well, this one is tricky. Given this criterion, would you say a raw pointer=
=20
satisfies it? IOW, does change(a) also applies to changing the referred to=
=20
(or pointed to) object?

int i =3D 0;
int j =3D 1;
optional<int&> oi =3D i;=20
optional<int&> oj =3D oi;

assert (oi =3D=3D oj); // holds

optional<int&> ok =3D oi;
oi =3D {j}; // this is the change(a)

assert (ok =3D=3D oj); // holds
assert (oj !=3D oi) // holds

j =3D 0;
assert (oj !=3D oi) // DOES NOT HOLD

And this is what I call an "asynchronous change". The value of 'j'=20
shouldn't affect the axioms.


> oh, and since I happen to always use construction above, I should=20
> mention assignment and construction yield the same results, ie:=20
>
> T a; a =3D b;  <=3D=3D> T a =3D b;=20
>

This holds
=20

>
> (he also requires less-than, but we can ignore that here)=20
>

operator< also works, with similar problems as operator=3D=3D
=20

>
> > The=20
> > value compared by operator=3D=3D is not under control of the optional=
=20
> object: it=20
> > can change "asynchronously".=20
>
> Let's limit our discussion to optionals over Ts where T is Regular.  I=20
> agree there is not much we can do when T is not Regular.=20
> So in general, optional<T> is Regular if T is Regular, I think. (?)=20
>

The problem I (clumsily) describe also works for Regular T's:

int i =3D 0;
int j =3D 0;
optional<int&> oi =3D i;
optional<int&> oj =3D j;

assert (oi =3D=3D oj);
i =3D 9; // the "asynchronous change"
assert (oi !=3D oj);=20
=20

>
> > Also the copy/move operations are not=20
> > compatible with operator=3D=3D: the former are shallow, the latter is d=
eep.=20
> >=20
>
> That the part I'm wondering about.  I guess the key thing is that even=20
> though T is regular, T & isn't, as the final a !=3D b assert fails.=20
> Using 'int' and 'int &' we get:=20
>
> int target =3D 17;=20
>
> int & b =3D target;=20
> int & a =3D b;=20
> assert(a =3D=3D b);=20
>
> int & c =3D b;=20
> change(a);=20
> assert(c =3D=3D b && a !=3D b);  // fails! as a =3D=3D b=20
>

Yes, raw references are not regular.
=20

>
> So does optional<int &> have the same semantics as int & (at least=20
> when the optional is engaged)?=20
> Except optional allows rebinding, whereas int & does not.=20
>

Given this assignment semantics, it is impossible to say if optional=20
references are 'like' raw references. They allow the same kind of departure=
=20
from RegularType. One could say that the only purpose of raw references=20
(and therefore also  optional references) is to depart from RegularType=20
requirements (especially: the "value separation")
=20

>
> Why not allow mixed assignment even?=20
>
> optional<int &> oi =3D target;=20
> oi =3D 123;=20
>

Here, you imply that the semantics would be non-rebinding:

oi =3D 123 <=3D=3D>  *oi =3D 123
(of course, if oi !=3D nullopt)

But that would be inconsistent with converting constructor: which only=20
binds a reference. Also the existence of this assignment was the reason=20
that caused the first revision of Optional to be rejected by the Committee.



> that would be consistent with int &.=20
> I guess it gets confusing with the rebinding?=20
>
> int alternate =3D 21;=20
> int another  =3D 35;=20
> oi =3D alternate;=20
> assert(target =3D=3D 21);=20
> oi =3D optional<int&>(another);=20
> oi =3D 42;=20
> assert(target !=3D 42);=20
> assert(another =3D=3D 42);=20
>

rebinding mixed assignment is confusing -- true. Non-rebinding one is=20
inconsistent with the homogenous assignment, though -- this would also be=
=20
confusing.


> I could live with mixed assignment.  Moreover, I think it is "more=20
> correct".=20
>

Is the above statement correct? You are considering the mixed assignment=20
because you could live with it?
=20

>
> So generic code wants to work generically (obviously) and typically on=20
> RegularTypes.  optional<> is not always regular.  How do I=20
> compile-time check that the target type is a reference?  I assume=20
> there is optional<>::value_type.  I don't expect that I can easily=20
> test that the value_type is regular (in general) but I can check if it=20
> is a reference.=20
>

yes, optional provides this value_type. I am not sure I agree with this=20
claim about the expectation that generic T is a RegularType. Consider=20
InputIterator-s.
=20

>
> Don't know what that says about your first argument in favour of=20
> optional references:=20
> "optional<T> can be used in generic code, were T can be either a=20
> reference or an object"=20
>
> I don't think generic code will typically work with both optional<T>=20
> and optional<T&> interchangeably. Nor do I think much generic code=20
> works with T and T& interchangeably.  The semantics are different,=20
> there isn't much of interest the generic code can reliably do.


Well, I agree with you here. And therewith I disagree with the statement in=
=20
my proposal :(
Personally, I cannot imagine why I would want to treat optional<T> and=20
optional<T&> generically. If you consider using=20
is_reference<optional<X>::value_type>, this is in fact a departure from=20
genericity. However, some users do insist on generic use. I hope, not only=
=20
on insisting per se. One convincing example I was shown was the following:
https://groups.google.com/a/isocpp.org/d/msg/std-proposals/cXneqUj-5oo/zCnK=
bHCGsxgJ
That is, you only want to forward the T, whatever it is.


> By the way, now that I've (re)read the Auxiliary part about optional=20
> references, I see you've covered much of this.  Hope I wasn't=20
> repeating too much, and something of the above was helpful.=20
>

It was useful. For instance you reminded me that a swap for optional=20
references should be re-enabled along with the assignment. Thanks!
=20

>
> And also the example:=20
>
> void assign_norebind(optional<T&>& optref, T& obj)=20
> {=20
>   if (optref) *optref =3D obj;=20
>   else        optref.emplace(obj);=20
> }=20
>
> Is that really useful?  It is 2 totally different semantics=20
> ("targetting" vs "set-value-of-target") rolled into one.=20
>

Some people insisted on this behavior for optional ref assignment. We do=20
not propose it, but if you need it, we show you how to do it. Nothing more.=
=20

Thank you for the input. I will improve the rationale section based on this=
=20
discussion.

Regards,
&rzej

--=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_98_19665365.1360145306280
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

<br><br>W dniu wtorek, 5 lutego 2013 23:39:16 UTC+1 u=BFytkownik Tony V E n=
apisa=B3:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Tue, Feb 5, 2013 a=
t 3:02 PM, Andrzej Krzemie=F1ski &lt;<a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"umK0-AhUhAwJ">akrz...@gmail.com</a>&gt; wrote:
<br>&gt;&gt;
<br>&gt;&gt; Is optional&lt;T&amp;&gt; a RegularType?
<br>&gt;
<br>&gt;
<br>&gt; I am not sure how to answer the question. Different people have sl=
ightly
<br>&gt; different expectations of a regular type.
<br>
<br>That's why I cc'ed Sean Parent :-)
<br>
<br>Let's go with Stepanov, via <a href=3D"http://www.stepanovpapers.com/De=
St98.pdf" target=3D"_blank">http://www.stepanovpapers.com/<wbr>DeSt98.pdf</=
a>
<br>and Elements of Programming (<a href=3D"http://www.elementsofprogrammin=
g.com" target=3D"_blank">www.elementsofprogramming.com</a><wbr>)
<br>
<br>&gt; optional&lt;T&amp;&gt; has:
<br>&gt;
<br>&gt; default ctor
<br>&gt; destructor
<br>&gt; copy/move constructor (shallow)
<br>&gt; copy/move assignment (shallow)
<br>&gt; equality comparison (deep, provided that T is comparable)
<br>&gt; it is not swappable yet, but I intend to add a shallow swap
<br>&gt;
<br>&gt; I am not not sure what semantic requirements a RegularType require=
s.
<br>
<br>To summarize Stepanov, mainly the semantics of int w.r.t. copy,
<br>assignment, and equality:
<br>
<br>T b =3D ...&lt;any value of T&gt;;
<br>T a =3D b;
<br>assert(a =3D=3D b);
<br></blockquote><div><br>This holds, but -- so to say -- only by chance <b=
r></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>T c =3D b;
<br>change(a);
<br>assert(c =3D=3D b &amp;&amp; a !=3D b);
<br></blockquote><div>&nbsp;</div><div>Well, this one is tricky. Given this=
 criterion, would you say a raw pointer satisfies it? IOW, does change(a) a=
lso applies to changing the referred to (or pointed to) object?<br><br>int =
i =3D 0;<br>int j =3D 1;<br>optional&lt;int&amp;&gt; oi =3D i; <br>optional=
&lt;int&amp;&gt; oj =3D oi;<br><br>assert (oi =3D=3D oj); // holds<br><br>o=
ptional&lt;int&amp;&gt; ok =3D oi;<br>oi =3D {j}; // this is the change(a)<=
br><br>assert (ok =3D=3D oj); // holds<br>assert (oj !=3D oi) // holds<br><=
br>j =3D 0;<br>assert (oj !=3D oi) // DOES NOT HOLD<br><br>And this is what=
 I call an "asynchronous change". The value of 'j' shouldn't affect the axi=
oms.<br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>oh, and since I happen to always use construction above, I should
<br>mention assignment and construction yield the same results, ie:
<br>
<br>T a; a =3D b; &nbsp;&lt;=3D=3D&gt; T a =3D b;
<br></blockquote><div><br>This holds<br>&nbsp;<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;">
<br>(he also requires less-than, but we can ignore that here)
<br></blockquote><div><br>operator&lt; also works, with similar problems as=
 operator=3D=3D<br>&nbsp;<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;">
<br>&gt; The
<br>&gt; value compared by operator=3D=3D is not under control of the optio=
nal object: it
<br>&gt; can change "asynchronously".
<br>
<br>Let's limit our discussion to optionals over Ts where T is Regular. &nb=
sp;I
<br>agree there is not much we can do when T is not Regular.
<br>So in general, optional&lt;T&gt; is Regular if T is Regular, I think. (=
?)
<br></blockquote><div><br>The problem I (clumsily) describe also works for =
Regular T's:<br><br>int i =3D 0;<br>int j =3D 0;<br>optional&lt;int&amp;&gt=
; oi =3D i;<br>optional&lt;int&amp;&gt; oj =3D j;<br><br>assert (oi =3D=3D =
oj);<br>i =3D 9; // the "asynchronous change"<br>assert (oi !=3D oj); <br>&=
nbsp;<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>&gt; Also the copy/move operations are not
<br>&gt; compatible with operator=3D=3D: the former are shallow, the latter=
 is deep.
<br>&gt;
<br>
<br>That the part I'm wondering about. &nbsp;I guess the key thing is that =
even
<br>though T is regular, T &amp; isn't, as the final a !=3D b assert fails.
<br>Using 'int' and 'int &amp;' we get:
<br>
<br>int target =3D 17;
<br>
<br>int &amp; b =3D target;
<br>int &amp; a =3D b;
<br>assert(a =3D=3D b);
<br>
<br>int &amp; c =3D b;
<br>change(a);
<br>assert(c =3D=3D b &amp;&amp; a !=3D b); &nbsp;// fails! as a =3D=3D b
<br></blockquote><div><br>Yes, raw references are not regular.<br>&nbsp;<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.=
8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>So does optional&lt;int &amp;&gt; have the same semantics as int &amp; =
(at least
<br>when the optional is engaged)?
<br>Except optional allows rebinding, whereas int &amp; does not.
<br></blockquote><div><br>Given this assignment semantics, it is impossible=
 to say if optional references are 'like' raw references. They allow the sa=
me kind of departure from RegularType. One could say that the only purpose =
of raw references (and therefore also&nbsp; optional references) is to depa=
rt from RegularType requirements (especially: the "value separation")<br>&n=
bsp;</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>Why not allow mixed assignment even?
<br>
<br>optional&lt;int &amp;&gt; oi =3D target;
<br>oi =3D 123;
<br></blockquote><div><br>Here, you imply that the semantics would be non-r=
ebinding:<br><br>oi =3D 123 &lt;=3D=3D&gt;&nbsp; *oi =3D 123<br>(of course,=
 if oi !=3D nullopt)<br><br>But that would be inconsistent with converting =
constructor: which only binds a reference. Also the existence of this assig=
nment was the reason that caused the first revision of Optional to be rejec=
ted by the Committee.<br><br><br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-lef=
t: 1ex;">
<br>that would be consistent with int &amp;.
<br>I guess it gets confusing with the rebinding?
<br>
<br>int alternate =3D 21;
<br>int another &nbsp;=3D 35;
<br>oi =3D alternate;
<br>assert(target =3D=3D 21);
<br>oi =3D optional&lt;int&amp;&gt;(another);
<br>oi =3D 42;
<br>assert(target !=3D 42);
<br>assert(another =3D=3D 42);
<br></blockquote><div><br>rebinding mixed assignment is confusing -- true. =
Non-rebinding one is inconsistent with the homogenous assignment, though --=
 this would also be confusing.<br><br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddin=
g-left: 1ex;">
<br>I could live with mixed assignment. &nbsp;Moreover, I think it is "more=
 correct".
<br></blockquote><div><br>Is the above statement correct? You are consideri=
ng the mixed assignment because you could live with it?<br>&nbsp;<br></div>=
<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bor=
der-left: 1px #ccc solid;padding-left: 1ex;">
<br>So generic code wants to work generically (obviously) and typically on
<br>RegularTypes. &nbsp;optional&lt;&gt; is not always regular. &nbsp;How d=
o I
<br>compile-time check that the target type is a reference? &nbsp;I assume
<br>there is optional&lt;&gt;::value_type. &nbsp;I don't expect that I can =
easily
<br>test that the value_type is regular (in general) but I can check if it
<br>is a reference.
<br></blockquote><div><br>yes, optional provides this value_type. I am not =
sure I agree with this claim about the expectation that generic T is a Regu=
larType. Consider InputIterator-s.<br>&nbsp;<br></div><blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;">
<br>Don't know what that says about your first argument in favour of
<br>optional references:
<br>"optional&lt;T&gt; can be used in generic code, were T can be either a
<br>reference or an object"
<br>
<br>I don't think generic code will typically work with both optional&lt;T&=
gt;
<br>and optional&lt;T&amp;&gt; interchangeably. Nor do I think much generic=
 code
<br>works with T and T&amp; interchangeably. &nbsp;The semantics are differ=
ent,
<br>there isn't much of interest the generic code can reliably do.</blockqu=
ote><div><br>Well, I agree with you here. And therewith I disagree with the=
 statement in my proposal :(<br>Personally, I cannot imagine why I would wa=
nt to treat optional&lt;T&gt; and optional&lt;T&amp;&gt; generically. If yo=
u consider using is_reference&lt;optional&lt;X&gt;::value_type&gt;, this is=
 in fact a departure from genericity. However, some users do insist on gene=
ric use. I hope, not only on insisting per se. One convincing example I was=
 shown was the following:<br>https://groups.google.com/a/isocpp.org/d/msg/s=
td-proposals/cXneqUj-5oo/zCnKbHCGsxgJ<br>That is, you only want to forward =
the T, whatever it is.<br><br></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;">
<br>By the way, now that I've (re)read the Auxiliary part about optional
<br>references, I see you've covered much of this. &nbsp;Hope I wasn't
<br>repeating too much, and something of the above was helpful.
<br></blockquote><div><br>It was useful. For instance you reminded me that =
a swap for optional references should be re-enabled along with the assignme=
nt. Thanks!<br>&nbsp;<br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
>
<br>And also the example:
<br>
<br>void assign_norebind(optional&lt;T&amp;&gt;&amp; optref, T&amp; obj)
<br>{
<br>&nbsp; if (optref) *optref =3D obj;
<br>&nbsp; else &nbsp; &nbsp; &nbsp; &nbsp;optref.emplace(obj);
<br>}
<br>
<br>Is that really useful? &nbsp;It is 2 totally different semantics
<br>("targetting" vs "set-value-of-target") rolled into one.
<br></blockquote><div><br>Some people insisted on this behavior for optiona=
l ref assignment. We do not propose it, but if you need it, we show you how=
 to do it. Nothing more. <br><br>Thank you for the input. I will improve th=
e rationale section based on this discussion.<br><br>Regards,<br>&amp;rzej<=
br></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_98_19665365.1360145306280--

.
