Topic: Static analysis and the future of C++
Author: mihailnajdenov@gmail.com
Date: Sun, 14 Jan 2018 05:40:26 -0800 (PST)
Raw View
------=_Part_2486_289920278.1515937226810
Content-Type: multipart/alternative;
boundary="----=_Part_2487_326759207.1515937226811"
------=_Part_2487_326759207.1515937226811
Content-Type: text/plain; charset="UTF-8"
Hello,
In recent years there is a boom of static analysis - from new languages
like Rust and Swift to the powerful tools, provided by C++ compilers.
However I don't see it C++ language *mandating* any of these. I have a
question - is this something the committee is looking into? Is there a
working group for this?
If a tool is a lifesaver, why is it not mandatory - who does not what to
save lifes?
I strongly believe bringing more (any?) static analysis into the language
is away to keep it modern and relevant, especially, considering C++ very
static language and has a lot of compile-time information the tools can
work with.
Any answers and thoughts are welcome.
Now on a concrete idea - to *use static analysis to make *_view classes
safe(er).*
Here is a suggestion:
struct A_view
{
A_view( [[dependent_lifetime]] A&& arg) : _a(&arg) {}
A* _a;
};
Now, given the code above using A_view, after ~A() is called on the
variable arg points to. will be marked as an error:
A_view ref(A{}); //< OK, no use of ref
A_view (A{}).func(); //< OK , A outlives ref
A_view ref(A{});
ref.func(); //< error/warning, ref used after A is destroyed
I believed this can be enforced by *any* compiler, as* long as *these
limitations apply.
1) A_view is not heap allocated
2) We forbid *all* uses of ref, not just uses involving _a;
These two limitations are there to avoid tracking lifetime through pointers.
Lifetime contract is exclusively b/w ref and *(&arg).
Considering the compiler is responsible to destroy both of these, it
*should* be possible to give a error/warning if variable ref is used after
variable *(&arg) is destroyed.
Copies of ref do not contribute to lifetime tracking - assumed is the view
outlives the viewed the same way it is assumed when the view is created
from a non-rvalue.
Comments are more then welcome, both on the broader topic about mandating
static analysis and the concrete proposal.
Thanks
Mihail Naydenov
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%40isocpp.org.
------=_Part_2487_326759207.1515937226811
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hello, </div><div>In recent years there is a boom of =
static analysis - from new languages like Rust and Swift to the powerful to=
ols, provided by C++ compilers.</div><div><br></div><div>However I don'=
t see it C++ language <i>mandating</i> any of these. I have a question - is=
this something the committee is looking into? Is there a working group for=
this?=C2=A0</div><div>If a tool is a lifesaver, why is it not mandatory - =
who does not what to save lifes?</div><div><br></div><div>I strongly believ=
e bringing more (any?) <span style=3D"display: inline !important; float: no=
ne; background-color: transparent; color: rgb(34, 34, 34); font-family: &qu=
ot;Arial","Helvetica",sans-serif; font-size: 13px; font-styl=
e: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; =
orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text=
-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word=
-spacing: 0px;">static analysis into the language is away to keep it modern=
and relevant, especially, considering C++ very static language and has a l=
ot of compile-time information the tools can work with.</span></div><div><b=
r></div><div>Any answers and thoughts are welcome.</div><div><br></div><div=
>Now on a concrete idea - to <b>use <span style=3D"text-align: left; color:=
rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing: n=
ormal; font-family: "Arial","Helvetica",sans-serif; fon=
t-size: 13px; font-style: normal; font-variant: normal; text-decoration: no=
ne; word-spacing: 0px; display: inline !important; white-space: normal; orp=
hans: 2; float: none; -webkit-text-stroke-width: 0px; background-color: tra=
nsparent;">static analysis to make *_view classes safe(er)</span>.</b></div=
><div><b><br></b></div><div>Here is a suggestion:</div><div><br></div><div>=
<font face=3D"courier new,monospace">struct A_view</font></div><div><font f=
ace=3D"courier new,monospace">{</font></div><div><font face=3D"courier new,=
monospace">=C2=A0 A_view( [[dependent_lifetime]]=C2=A0 A&& arg) : _=
a(&arg) {}</font></div><div><font face=3D"courier new,monospace">=C2=A0=
A* _a;</font></div><div><font face=3D"courier new,monospace">};</font></di=
v><div><font face=3D"courier new,monospace"><br></font></div><div>Now, give=
n the code above using A_view, after ~A() is called on the variable arg poi=
nts to. will be marked as an error:</div><div><br></div><div><font face=3D"=
courier new,monospace">A_view ref(A{}); //< OK, no use of ref</font></di=
v><div><font face=3D"courier new,monospace"><br></font></div><div><span sty=
le=3D"text-align: left; color: rgb(34, 34, 34); text-transform: none; text-=
indent: 0px; letter-spacing: normal; font-size: 13px; font-style: normal; f=
ont-variant: normal; font-weight: 400; text-decoration: none; word-spacing:=
0px; display: inline !important; white-space: normal; orphans: 2; float: n=
one; -webkit-text-stroke-width: 0px; background-color: transparent;"><font =
face=3D"courier new,monospace">A_view (A{}).func(); //< OK , A outlives =
ref</font></span></div><div><span style=3D"text-align: left; color: rgb(34,=
34, 34); text-transform: none; text-indent: 0px; letter-spacing: normal; f=
ont-size: 13px; font-style: normal; font-variant: normal; font-weight: 400;=
text-decoration: none; word-spacing: 0px; display: inline !important; whit=
e-space: normal; orphans: 2; float: none; -webkit-text-stroke-width: 0px; b=
ackground-color: transparent;"><font face=3D"courier new,monospace"><br></f=
ont></span></div><div><span style=3D"text-align: left; color: rgb(34, 34, 3=
4); text-transform: none; text-indent: 0px; letter-spacing: normal; font-si=
ze: 13px; font-variant: normal; word-spacing: 0px; display: inline !importa=
nt; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-width=
: 0px; background-color: transparent;"><span style=3D"text-align: left; col=
or: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing=
: normal; font-size: 13px; font-style: normal; font-variant: normal; font-w=
eight: 400; text-decoration: none; word-spacing: 0px; display: inline !impo=
rtant; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-wi=
dth: 0px; background-color: transparent;"><font face=3D"courier new,monospa=
ce">A_view ref(A{});</font></span></span></div><div><font face=3D"courier n=
ew,monospace">ref<span style=3D"text-align: left; color: rgb(34, 34, 34); t=
ext-transform: none; text-indent: 0px; letter-spacing: normal; font-size: 1=
3px; font-variant: normal; word-spacing: 0px; display: inline !important; w=
hite-space: normal; orphans: 2; float: none; -webkit-text-stroke-width: 0px=
; background-color: transparent;"><span style=3D"text-align: left; color: r=
gb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing: nor=
mal; font-size: 13px; font-style: normal; font-variant: normal; font-weight=
: 400; text-decoration: none; word-spacing: 0px; display: inline !important=
; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-width: =
0px; background-color: transparent;">.func(); //< error/warning, ref use=
d after A is destroyed</span></span></font></div><div><font face=3D"courier=
new,monospace"><span style=3D"text-align: left; color: rgb(34, 34, 34); te=
xt-transform: none; text-indent: 0px; letter-spacing: normal; font-size: 13=
px; font-variant: normal; word-spacing: 0px; display: inline !important; wh=
ite-space: normal; orphans: 2; float: none; -webkit-text-stroke-width: 0px;=
background-color: transparent;"><span style=3D"text-align: left; color: rg=
b(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing: norm=
al; font-size: 13px; font-style: normal; font-variant: normal; font-weight:=
400; text-decoration: none; word-spacing: 0px; display: inline !important;=
white-space: normal; orphans: 2; float: none; -webkit-text-stroke-width: 0=
px; background-color: transparent;"><br></span></span></font></div><div><sp=
an style=3D"text-align: left; color: rgb(34, 34, 34); text-transform: none;=
text-indent: 0px; letter-spacing: normal; font-size: 13px; font-variant: n=
ormal; word-spacing: 0px; display: inline !important; white-space: normal; =
orphans: 2; float: none; -webkit-text-stroke-width: 0px; background-color: =
transparent;"><span style=3D"text-align: left; color: rgb(34, 34, 34); text=
-transform: none; text-indent: 0px; letter-spacing: normal; font-size: 13px=
; font-style: normal; font-variant: normal; font-weight: 400; text-decorati=
on: none; word-spacing: 0px; display: inline !important; white-space: norma=
l; orphans: 2; float: none; -webkit-text-stroke-width: 0px; background-colo=
r: transparent;"><font face=3D"arial,sans-serif">I believed this can be enf=
orced by <i>any</i> compiler, as<i> long as </i>these limitations apply.</f=
ont></span></span></div><div>1) A_view is not heap allocated=C2=A0</div><di=
v>2) We forbid <b>all</b> uses of <font face=3D"courier new,monospace">ref<=
/font>, not just uses involving _a;</div><div><br></div><div>These two limi=
tations are there to avoid tracking lifetime through pointers.</div><div><b=
r></div><div>Lifetime contract is exclusively b/w <font face=3D"courier new=
,monospace">ref </font><font face=3D"arial,sans-serif">and</font><font face=
=3D"courier new,monospace"> *(&arg).=C2=A0</font></div><div><font face=
=3D"arial,sans-serif">Considering the compiler is responsible to destroy bo=
th of these, it <i>should</i> be possible to give a error/warning if variab=
le <font face=3D"courier new,monospace">ref</font> is used after variable=
=C2=A0<span style=3D"display: inline !important; float: none; background-co=
lor: transparent; color: rgb(34, 34, 34); font-family: courier new,monospac=
e; font-size: 13px; font-style: normal; font-variant: normal; font-weight: =
400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;">*(&arg)<font face=3D"arial=
,sans-serif"> </font><font face=3D"arial,sans-serif">is destroyed.</font></=
span></font></div><div><font face=3D"arial,sans-serif">Copies of <font face=
=3D"courier new,monospace">ref</font> do not contribute to lifetime trackin=
g - assumed is the view outlives the viewed the same way it is assumed when=
the view is created from a non-rvalue.</font><font face=3D"arial,sans-seri=
f"><i><b></b></i></font></div><div><b><i><font face=3D"arial,sans-serif"><b=
r></font></i></b></div><div><font face=3D"arial,sans-serif">Comments are mo=
re then welcome, both on the broader topic about mandating static analysis =
and the concrete proposal.</font></div><div><br></div><div>Thanks=C2=A0</di=
v><div>Mihail Naydenov</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca=
%40isocpp.org</a>.<br />
------=_Part_2487_326759207.1515937226811--
------=_Part_2486_289920278.1515937226810--
.
Author: j c <james.a.cooper@gmail.com>
Date: Sun, 14 Jan 2018 15:39:04 +0000
Raw View
--94eb2c0b04de2e3d1c0562be4ce9
Content-Type: text/plain; charset="UTF-8"
This discussion will be pointless until C++ decides what it should do when
built-in static analysers discover undefined behaviour.
Right now they use it as an excuse to generate heavily optimised, but
ultimately incorrect, programs instead of just bailing out of the compile.
On Sunday, January 14, 2018, <mihailnajdenov@gmail.com> wrote:
> Hello,
> In recent years there is a boom of static analysis - from new languages
> like Rust and Swift to the powerful tools, provided by C++ compilers.
>
> However I don't see it C++ language *mandating* any of these. I have a
> question - is this something the committee is looking into? Is there a
> working group for this?
> If a tool is a lifesaver, why is it not mandatory - who does not what to
> save lifes?
>
> I strongly believe bringing more (any?) static analysis into the language
> is away to keep it modern and relevant, especially, considering C++ very
> static language and has a lot of compile-time information the tools can
> work with.
>
> Any answers and thoughts are welcome.
>
> Now on a concrete idea - to *use static analysis to make *_view classes
> safe(er).*
>
> Here is a suggestion:
>
> struct A_view
> {
> A_view( [[dependent_lifetime]] A&& arg) : _a(&arg) {}
> A* _a;
> };
>
> Now, given the code above using A_view, after ~A() is called on the
> variable arg points to. will be marked as an error:
>
> A_view ref(A{}); //< OK, no use of ref
>
> A_view (A{}).func(); //< OK , A outlives ref
>
> A_view ref(A{});
> ref.func(); //< error/warning, ref used after A is destroyed
>
> I believed this can be enforced by *any* compiler, as* long as *these
> limitations apply.
> 1) A_view is not heap allocated
> 2) We forbid *all* uses of ref, not just uses involving _a;
>
> These two limitations are there to avoid tracking lifetime through
> pointers.
>
> Lifetime contract is exclusively b/w ref and *(&arg).
> Considering the compiler is responsible to destroy both of these, it
> *should* be possible to give a error/warning if variable ref is used
> after variable *(&arg) is destroyed.
> Copies of ref do not contribute to lifetime tracking - assumed is the
> view outlives the viewed the same way it is assumed when the view is
> created from a non-rvalue.
>
> Comments are more then welcome, both on the broader topic about mandating
> static analysis and the concrete proposal.
>
> Thanks
> Mihail Naydenov
>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-
> 8d43-5bfaf0af62ca%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJVsW8Yn5LRgzAyc0abLiyQ%40mail.gmail.com.
--94eb2c0b04de2e3d1c0562be4ce9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
This discussion will be pointless until C++ decides what it should do when =
built-in static analysers discover undefined behaviour.<div>Right now they =
use it as an excuse to generate heavily optimised, but ultimately incorrect=
, programs instead of just bailing out of the compile.<br><br>On Sunday, Ja=
nuary 14, 2018, <<a href=3D"mailto:mihailnajdenov@gmail.com">mihailnajd=
enov@gmail.com</a>> wrote:<br><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D=
"ltr"><div>Hello, </div><div>In recent years there is a boom of static anal=
ysis - from new languages like Rust and Swift to the powerful tools, provid=
ed by C++ compilers.</div><div><br></div><div>However I don't see it C+=
+ language <i>mandating</i> any of these. I have a question - is this somet=
hing the committee is looking into? Is there a working group for this?=C2=
=A0</div><div>If a tool is a lifesaver, why is it not mandatory - who does =
not what to save lifes?</div><div><br></div><div>I strongly believe bringin=
g more (any?) <span style=3D"display:inline!important;float:none;background=
-color:transparent;color:rgb(34,34,34);font-family:"Arial","=
Helvetica",sans-serif;font-size:13px;font-style:normal;font-variant:no=
rmal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:=
none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0p=
x">static analysis into the language is away to keep it modern and relevant=
, especially, considering C++ very static language and has a lot of compile=
-time information the tools can work with.</span></div><div><br></div><div>=
Any answers and thoughts are welcome.</div><div><br></div><div>Now on a con=
crete idea - to <b>use <span style=3D"text-align:left;color:rgb(34,34,34);t=
ext-transform:none;text-indent:0px;letter-spacing:normal;font-family:"=
Arial","Helvetica",sans-serif;font-size:13px;font-style:norm=
al;font-variant:normal;text-decoration:none;word-spacing:0px;display:inline=
!important;white-space:normal;float:none;background-color:transparent">stat=
ic analysis to make *_view classes safe(er)</span>.</b></div><div><b><br></=
b></div><div>Here is a suggestion:</div><div><br></div><div><font face=3D"c=
ourier new,monospace">struct A_view</font></div><div><font face=3D"courier =
new,monospace">{</font></div><div><font face=3D"courier new,monospace">=C2=
=A0 A_view( [[dependent_lifetime]]=C2=A0 A&& arg) : _a(&arg) {}=
</font></div><div><font face=3D"courier new,monospace">=C2=A0 A* _a;</font>=
</div><div><font face=3D"courier new,monospace">};</font></div><div><font f=
ace=3D"courier new,monospace"><br></font></div><div>Now, given the code abo=
ve using A_view, after ~A() is called on the variable arg points to. will b=
e marked as an error:</div><div><br></div><div><font face=3D"courier new,mo=
nospace">A_view ref(A{}); //< OK, no use of ref</font></div><div><font f=
ace=3D"courier new,monospace"><br></font></div><div><span style=3D"text-ali=
gn:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spac=
ing:normal;font-size:13px;font-style:normal;font-variant:normal;font-weight=
:400;text-decoration:none;word-spacing:0px;display:inline!important;white-s=
pace:normal;float:none;background-color:transparent"><font face=3D"courier =
new,monospace">A_view (A{}).func(); //< OK , A outlives ref</font></span=
></div><div><span style=3D"text-align:left;color:rgb(34,34,34);text-transfo=
rm:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:nor=
mal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0=
px;display:inline!important;white-space:normal;float:none;background-color:=
transparent"><font face=3D"courier new,monospace"><br></font></span></div><=
div><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;=
text-indent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;wo=
rd-spacing:0px;display:inline!important;white-space:normal;float:none;backg=
round-color:transparent"><span style=3D"text-align:left;color:rgb(34,34,34)=
;text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;f=
ont-style:normal;font-variant:normal;font-weight:400;text-decoration:none;w=
ord-spacing:0px;display:inline!important;white-space:normal;float:none;back=
ground-color:transparent"><font face=3D"courier new,monospace">A_view ref(A=
{});</font></span></span></div><div><font face=3D"courier new,monospace">re=
f<span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;tex=
t-indent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;word-=
spacing:0px;display:inline!important;white-space:normal;float:none;backgrou=
nd-color:transparent"><span style=3D"text-align:left;color:rgb(34,34,34);te=
xt-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font=
-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word=
-spacing:0px;display:inline!important;white-space:normal;float:none;backgro=
und-color:transparent">.func(); //< error/warning, ref used after A is d=
estroyed</span></span></font></div><div><font face=3D"courier new,monospace=
"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;te=
xt-indent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;word=
-spacing:0px;display:inline!important;white-space:normal;float:none;backgro=
und-color:transparent"><span style=3D"text-align:left;color:rgb(34,34,34);t=
ext-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;fon=
t-style:normal;font-variant:normal;font-weight:400;text-decoration:none;wor=
d-spacing:0px;display:inline!important;white-space:normal;float:none;backgr=
ound-color:transparent"><br></span></span></font></div><div><span style=3D"=
text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;let=
ter-spacing:normal;font-size:13px;font-variant:normal;word-spacing:0px;disp=
lay:inline!important;white-space:normal;float:none;background-color:transpa=
rent"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:non=
e;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;fo=
nt-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;dis=
play:inline!important;white-space:normal;float:none;background-color:transp=
arent"><font face=3D"arial,sans-serif">I believed this can be enforced by <=
i>any</i> compiler, as<i> long as </i>these limitations apply.</font></span=
></span></div><div>1) A_view is not heap allocated=C2=A0</div><div>2) We fo=
rbid <b>all</b> uses of <font face=3D"courier new,monospace">ref</font>, no=
t just uses involving _a;</div><div><br></div><div>These two limitations ar=
e there to avoid tracking lifetime through pointers.</div><div><br></div><d=
iv>Lifetime contract is exclusively b/w <font face=3D"courier new,monospace=
">ref </font><font face=3D"arial,sans-serif">and</font><font face=3D"courie=
r new,monospace"> *(&arg).=C2=A0</font></div><div><font face=3D"arial,s=
ans-serif">Considering the compiler is responsible to destroy both of these=
, it <i>should</i> be possible to give a error/warning if variable <font fa=
ce=3D"courier new,monospace">ref</font> is used after variable=C2=A0<span s=
tyle=3D"display:inline!important;float:none;background-color:transparent;co=
lor:rgb(34,34,34);font-family:courier new,monospace;font-size:13px;font-sty=
le:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-al=
ign:left;text-decoration:none;text-indent:0px;text-transform:none;white-spa=
ce:normal;word-spacing:0px">*(&arg)<font face=3D"arial,sans-serif"> </f=
ont><font face=3D"arial,sans-serif">is destroyed.</font></span></font></div=
><div><font face=3D"arial,sans-serif">Copies of <font face=3D"courier new,m=
onospace">ref</font> do not contribute to lifetime tracking - assumed is th=
e view outlives the viewed the same way it is assumed when the view is crea=
ted from a non-rvalue.</font><font face=3D"arial,sans-serif"><i><b></b></i>=
</font></div><div><b><i><font face=3D"arial,sans-serif"><br></font></i></b>=
</div><div><font face=3D"arial,sans-serif">Comments are more then welcome, =
both on the broader topic about mandating static analysis and the concrete =
proposal.</font></div><div><br></div><div>Thanks=C2=A0</div><div>Mihail Nay=
denov</div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/0087=
c1a4-0b36-40ca-<wbr>8d43-5bfaf0af62ca%40isocpp.org</a><wbr>.<br>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJVsW8Yn5=
LRgzAyc0abLiyQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRo=
BzBJsjQGUi2wJVsW8Yn5LRgzAyc0abLiyQ%40mail.gmail.com</a>.<br />
--94eb2c0b04de2e3d1c0562be4ce9--
.
Author: Andrey Semashev <andrey.semashev@gmail.com>
Date: Sun, 14 Jan 2018 18:50:58 +0300
Raw View
On 01/14/18 16:40, mihailnajdenov@gmail.com wrote:
> Hello,
> In recent years there is a boom of static analysis - from new languages
> like Rust and Swift to the powerful tools, provided by C++ compilers.
>
> However I don't see it C++ language /mandating/ any of these. I have a
> question - is this something the committee is looking into? Is there a
> working group for this?
> If a tool is a lifesaver, why is it not mandatory - who does not what to
> save lifes?
>
> I strongly believe bringing more (any?) static analysis into the
> language is away to keep it modern and relevant, especially, considering
> C++ very static language and has a lot of compile-time information the
> tools can work with.
>
> Any answers and thoughts are welcome.
How does *mandating* a particular tool help language users? If you can
use a tool right now, why do you want to enforce it on everyone?
Also, what should we do about the platforms where such tools are not
available?
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/3d1ee12f-b97a-f259-b98a-831153b4245e%40gmail.com.
.
Author: =?UTF-8?Q?Micha=C5=82_Dominiak?= <griwes@griwes.info>
Date: Sun, 14 Jan 2018 15:58:11 +0000
Raw View
--089e08205a5c225f360562be9111
Content-Type: text/plain; charset="UTF-8"
On Sun, Jan 14, 2018 at 4:39 PM j c <james.a.cooper@gmail.com> wrote:
> This discussion will be pointless until C++ decides what it should do when
> built-in static analysers discover undefined behaviour.
> Right now they use it as an excuse to generate heavily optimised, but
> ultimately incorrect, programs instead of just bailing out of the compile.
>
>
If you find that your implementation generates an incorrect program out of
your code, then file a bug against that implementation.
Of course it is meaningless to speak about program correctness when your
program violates the rules given by the specification, which includes
actually executing through undefined behavior.
> On Sunday, January 14, 2018, <mihailnajdenov@gmail.com> wrote:
>
>> Hello,
>> In recent years there is a boom of static analysis - from new languages
>> like Rust and Swift to the powerful tools, provided by C++ compilers.
>>
>> However I don't see it C++ language *mandating* any of these. I have a
>> question - is this something the committee is looking into? Is there a
>> working group for this?
>> If a tool is a lifesaver, why is it not mandatory - who does not what to
>> save lifes?
>>
>> I strongly believe bringing more (any?) static analysis into the
>> language is away to keep it modern and relevant, especially, considering
>> C++ very static language and has a lot of compile-time information the
>> tools can work with.
>>
>> Any answers and thoughts are welcome.
>>
>> Now on a concrete idea - to *use static analysis to make *_view classes
>> safe(er).*
>>
>> Here is a suggestion:
>>
>> struct A_view
>> {
>> A_view( [[dependent_lifetime]] A&& arg) : _a(&arg) {}
>> A* _a;
>> };
>>
>> Now, given the code above using A_view, after ~A() is called on the
>> variable arg points to. will be marked as an error:
>>
>> A_view ref(A{}); //< OK, no use of ref
>>
>> A_view (A{}).func(); //< OK , A outlives ref
>>
>> A_view ref(A{});
>> ref.func(); //< error/warning, ref used after A is destroyed
>>
>> I believed this can be enforced by *any* compiler, as* long as *these
>> limitations apply.
>> 1) A_view is not heap allocated
>> 2) We forbid *all* uses of ref, not just uses involving _a;
>>
>> These two limitations are there to avoid tracking lifetime through
>> pointers.
>>
>> Lifetime contract is exclusively b/w ref and *(&arg).
>> Considering the compiler is responsible to destroy both of these, it
>> *should* be possible to give a error/warning if variable ref is used
>> after variable *(&arg) is destroyed.
>> Copies of ref do not contribute to lifetime tracking - assumed is the
>> view outlives the viewed the same way it is assumed when the view is
>> created from a non-rvalue.
>>
>> Comments are more then welcome, both on the broader topic about mandating
>> static analysis and the concrete proposal.
>>
>> Thanks
>> Mihail Naydenov
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJVsW8Yn5LRgzAyc0abLiyQ%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJVsW8Yn5LRgzAyc0abLiyQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdS6%2BvR%3DsfU_-uD%3D_MQ%2BHz0bqfRmwss-ydBdh5yfO4%3DaVA%40mail.gmail.com.
--089e08205a5c225f360562be9111
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Sun, Jan 14=
, 2018 at 4:39 PM j c <<a href=3D"mailto:james.a.cooper@gmail.com">james=
..a.cooper@gmail.com</a>> wrote:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
This discussion will be pointless until C++ decides what it should do when =
built-in static analysers discover undefined behaviour.<div>Right now they =
use it as an excuse to generate heavily optimised, but ultimately incorrect=
, programs instead of just bailing out of the compile.</div><div><br></div>=
</blockquote><div><br></div><div>If you find that your implementation gener=
ates an incorrect program out of your code, then file a bug against that im=
plementation.</div><div><br></div><div>Of course it is meaningless to speak=
about program correctness when your program violates the rules given by th=
e specification, which includes actually executing through undefined behavi=
or.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>On Sunday, =
January 14, 2018, <<a href=3D"mailto:mihailnajdenov@gmail.com" target=
=3D"_blank">mihailnajdenov@gmail.com</a>> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex"><div dir=3D"ltr"><div>Hello, </div><div>In recent years there is=
a boom of static analysis - from new languages like Rust and Swift to the =
powerful tools, provided by C++ compilers.</div><div><br></div><div>However=
I don't see it C++ language <i>mandating</i> any of these. I have a qu=
estion - is this something the committee is looking into? Is there a workin=
g group for this?=C2=A0</div><div>If a tool is a lifesaver, why is it not m=
andatory - who does not what to save lifes?</div><div><br></div><div>I stro=
ngly believe bringing more (any?) <span style=3D"display:inline!important;f=
loat:none;background-color:transparent;color:rgb(34,34,34);font-family:&quo=
t;Arial","Helvetica",sans-serif;font-size:13px;font-style:no=
rmal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:l=
eft;text-decoration:none;text-indent:0px;text-transform:none;white-space:no=
rmal;word-spacing:0px">static analysis into the language is away to keep it=
modern and relevant, especially, considering C++ very static language and =
has a lot of compile-time information the tools can work with.</span></div>=
<div><br></div><div>Any answers and thoughts are welcome.</div><div><br></d=
iv><div>Now on a concrete idea - to <b>use <span style=3D"text-align:left;c=
olor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:norma=
l;font-family:"Arial","Helvetica",sans-serif;font-size:=
13px;font-style:normal;font-variant:normal;text-decoration:none;word-spacin=
g:0px;display:inline!important;white-space:normal;float:none;background-col=
or:transparent">static analysis to make *_view classes safe(er)</span>.</b>=
</div><div><b><br></b></div><div>Here is a suggestion:</div><div><br></div>=
<div><font face=3D"courier new,monospace">struct A_view</font></div><div><f=
ont face=3D"courier new,monospace">{</font></div><div><font face=3D"courier=
new,monospace">=C2=A0 A_view( [[dependent_lifetime]]=C2=A0 A&& arg=
) : _a(&arg) {}</font></div><div><font face=3D"courier new,monospace">=
=C2=A0 A* _a;</font></div><div><font face=3D"courier new,monospace">};</fon=
t></div><div><font face=3D"courier new,monospace"><br></font></div><div>Now=
, given the code above using A_view, after ~A() is called on the variable a=
rg points to. will be marked as an error:</div><div><br></div><div><font fa=
ce=3D"courier new,monospace">A_view ref(A{}); //< OK, no use of ref</fon=
t></div><div><font face=3D"courier new,monospace"><br></font></div><div><sp=
an style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-in=
dent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-varian=
t:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inli=
ne!important;white-space:normal;float:none;background-color:transparent"><f=
ont face=3D"courier new,monospace">A_view (A{}).func(); //< OK , A outli=
ves ref</font></span></div><div><span style=3D"text-align:left;color:rgb(34=
,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-size=
:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration=
:none;word-spacing:0px;display:inline!important;white-space:normal;float:no=
ne;background-color:transparent"><font face=3D"courier new,monospace"><br><=
/font></span></div><div><span style=3D"text-align:left;color:rgb(34,34,34);=
text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;fo=
nt-variant:normal;word-spacing:0px;display:inline!important;white-space:nor=
mal;float:none;background-color:transparent"><span style=3D"text-align:left=
;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:nor=
mal;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;te=
xt-decoration:none;word-spacing:0px;display:inline!important;white-space:no=
rmal;float:none;background-color:transparent"><font face=3D"courier new,mon=
ospace">A_view ref(A{});</font></span></span></div><div><font face=3D"couri=
er new,monospace">ref<span style=3D"text-align:left;color:rgb(34,34,34);tex=
t-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-=
variant:normal;word-spacing:0px;display:inline!important;white-space:normal=
;float:none;background-color:transparent"><span style=3D"text-align:left;co=
lor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal=
;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-=
decoration:none;word-spacing:0px;display:inline!important;white-space:norma=
l;float:none;background-color:transparent">.func(); //< error/warning, r=
ef used after A is destroyed</span></span></font></div><div><font face=3D"c=
ourier new,monospace"><span style=3D"text-align:left;color:rgb(34,34,34);te=
xt-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font=
-variant:normal;word-spacing:0px;display:inline!important;white-space:norma=
l;float:none;background-color:transparent"><span style=3D"text-align:left;c=
olor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:norma=
l;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text=
-decoration:none;word-spacing:0px;display:inline!important;white-space:norm=
al;float:none;background-color:transparent"><br></span></span></font></div>=
<div><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none=
;text-indent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;w=
ord-spacing:0px;display:inline!important;white-space:normal;float:none;back=
ground-color:transparent"><span style=3D"text-align:left;color:rgb(34,34,34=
);text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;=
font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;=
word-spacing:0px;display:inline!important;white-space:normal;float:none;bac=
kground-color:transparent"><font face=3D"arial,sans-serif">I believed this =
can be enforced by <i>any</i> compiler, as<i> long as </i>these limitations=
apply.</font></span></span></div><div>1) A_view is not heap allocated=C2=
=A0</div><div>2) We forbid <b>all</b> uses of <font face=3D"courier new,mon=
ospace">ref</font>, not just uses involving _a;</div><div><br></div><div>Th=
ese two limitations are there to avoid tracking lifetime through pointers.<=
/div><div><br></div><div>Lifetime contract is exclusively b/w <font face=3D=
"courier new,monospace">ref </font><font face=3D"arial,sans-serif">and</fon=
t><font face=3D"courier new,monospace"> *(&arg).=C2=A0</font></div><div=
><font face=3D"arial,sans-serif">Considering the compiler is responsible to=
destroy both of these, it <i>should</i> be possible to give a error/warnin=
g if variable <font face=3D"courier new,monospace">ref</font> is used after=
variable=C2=A0<span style=3D"display:inline!important;float:none;backgroun=
d-color:transparent;color:rgb(34,34,34);font-family:courier new,monospace;f=
ont-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter-=
spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-tr=
ansform:none;white-space:normal;word-spacing:0px">*(&arg)<font face=3D"=
arial,sans-serif"> </font><font face=3D"arial,sans-serif">is destroyed.</fo=
nt></span></font></div><div><font face=3D"arial,sans-serif">Copies of <font=
face=3D"courier new,monospace">ref</font> do not contribute to lifetime tr=
acking - assumed is the view outlives the viewed the same way it is assumed=
when the view is created from a non-rvalue.</font><font face=3D"arial,sans=
-serif"><i><b></b></i></font></div><div><b><i><font face=3D"arial,sans-seri=
f"><br></font></i></b></div><div><font face=3D"arial,sans-serif">Comments a=
re more then welcome, both on the broader topic about mandating static anal=
ysis and the concrete proposal.</font></div><div><br></div><div>Thanks=C2=
=A0</div><div>Mihail Naydenov</div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-=
40ca-8d43-5bfaf0af62ca%40isocpp.org</a>.<br>
</blockquote></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJVsW8Yn5=
LRgzAyc0abLiyQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-propo=
sals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJVsW8Yn5LRgzAyc0abLiyQ%40mail.gmail.com</=
a>.<br>
</blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAPCFJdS6%2BvR%3DsfU_-uD%3D_MQ%2BHz0b=
qfRmwss-ydBdh5yfO4%3DaVA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Df=
ooter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJd=
S6%2BvR%3DsfU_-uD%3D_MQ%2BHz0bqfRmwss-ydBdh5yfO4%3DaVA%40mail.gmail.com</a>=
..<br />
--089e08205a5c225f360562be9111--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sun, 14 Jan 2018 08:03:45 -0800 (PST)
Raw View
------=_Part_2965_1898407645.1515945825171
Content-Type: multipart/alternative;
boundary="----=_Part_2966_810626191.1515945825172"
------=_Part_2966_810626191.1515945825172
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 14, 2018 at 8:40:26 AM UTC-5, mihailn...@gmail.com wrote:
>
> Hello,
> In recent years there is a boom of static analysis - from new languages
> like Rust and Swift to the powerful tools, provided by C++ compilers.
>
> However I don't see it C++ language *mandating* any of these.
>
.... why would it?
The standard defines behavior. The standard decides what is valid language
and how it behaves.
Static analysis is for looking at what is valid language and deciding
whether or not it's likely that the behavior your code gets is the behavior
you actually wanted. If you make a change to the language, you aren't "using
static analysis"; you've made something *linguistically* impossible.
It's like the difference between saying "we shouldn't swear" vs. removing
swear words from the English language entirely.
Whether compilers include static analysis tools, and how they are used, is
out-of-bounds for the standard. Though you could think of contracts as a
mechanism to make static analysis easier, that's more a useful additional
thing that contracts do.
I have a question - is this something the committee is looking into? Is
> there a working group for this?
> If a tool is a lifesaver, why is it not mandatory - who does not what to
> save lifes?
>
> I strongly believe bringing more (any?) static analysis into the language
> is away to keep it modern and relevant, especially, considering C++ very
> static language and has a lot of compile-time information the tools can
> work with.
>
> Any answers and thoughts are welcome.
>
> Now on a concrete idea - to *use static analysis to make *_view classes
> safe(er).*
>
This is the wrong tool for the job. The ideal solution is to make such code *ill
formed*, not to rely on "static analysis" to make compilers give a warning
or something.
Or better yet, to change the language to make such code *functional*. After
all, if you're going to go through the effort of tagging a function with
this attribute, why not tag it with a keyword that extends the lifetime of
the temporary correctly?
A_view(extend A&& arg) : _a(&arg) {}
....
A_view ref(A{}); //A{}'s lifetime is extended to that of the declaration's
enclosing scope.
Here is a suggestion:
>
> struct A_view
> {
> A_view( [[dependent_lifetime]] A&& arg) : _a(&arg) {}
> A* _a;
> };
>
> Now, given the code above using A_view, after ~A() is called on the
> variable arg points to. will be marked as an error:
>
> A_view ref(A{}); //< OK, no use of ref
>
> A_view (A{}).func(); //< OK , A outlives ref
>
> A_view ref(A{});
> ref.func(); //< error/warning, ref used after A is destroyed
>
> I believed this can be enforced by *any* compiler, as* long as *these
> limitations apply.
> 1) A_view is not heap allocated
> 2) We forbid *all* uses of ref, not just uses involving _a;
>
> These two limitations are there to avoid tracking lifetime through
> pointers.
>
> Lifetime contract is exclusively b/w ref and *(&arg).
> Considering the compiler is responsible to destroy both of these, it
> *should* be possible to give a error/warning if variable ref is used
> after variable *(&arg) is destroyed.
> Copies of ref do not contribute to lifetime tracking - assumed is the
> view outlives the viewed the same way it is assumed when the view is
> created from a non-rvalue.
>
> Comments are more then welcome, both on the broader topic about mandating
> static analysis and the concrete proposal.
>
> Thanks
> Mihail Naydenov
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4270ffec-ccc7-4abd-836d-213db296be84%40isocpp.org.
------=_Part_2966_810626191.1515945825172
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Sunday, January 14, 2018 at 8:40:26 AM UTC-5, mihailn..=
..@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr"><div>Hello, </div><div>In recent years there is a boom of static analy=
sis - from new languages like Rust and Swift to the powerful tools, provide=
d by C++ compilers.</div><div><br></div><div>However I don't see it C++=
language <i>mandating</i> any of these.</div></div></blockquote><div><br><=
/div><div>... why would it?</div><div><br></div><div>The standard defines b=
ehavior. The standard decides what is valid language and how it behaves.</d=
iv><div><br></div><div>Static analysis is for looking at what is valid lang=
uage and deciding whether or not it's likely that the behavior your cod=
e gets is the behavior you actually wanted. If you make a change to the lan=
guage, you aren't "<span style=3D"display: inline !important; floa=
t: none; background-color: transparent; color: rgb(34, 34, 34); font-family=
: "Arial","Helvetica",sans-serif; font-size: 13px; font=
-style: normal; font-variant: normal; font-weight: 400; letter-spacing: nor=
mal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px;=
text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal;=
word-spacing: 0px;">using </span>static analysis"; you've made so=
mething <i>linguistically</i> impossible.</div><div><br></div><div>It's=
like the difference between saying "we shouldn't swear" vs. =
removing swear words from the English language entirely.</div><div><br></di=
v><div>Whether compilers include static analysis tools, and how they are us=
ed, is out-of-bounds for the standard. Though you could think of contracts =
as a mechanism to make static analysis easier, that's more a useful add=
itional thing that contracts do.</div><div><br></div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc sol=
id;padding-left: 1ex;"><div dir=3D"ltr"><div>I have a question - is this so=
mething the committee is looking into? Is there a working group for this?=
=C2=A0</div><div>If a tool is a lifesaver, why is it not mandatory - who do=
es not what to save lifes?</div><div><br></div><div>I strongly believe brin=
ging more (any?) <span style=3D"display:inline!important;float:none;backgro=
und-color:transparent;color:rgb(34,34,34);font-family:"Arial",&qu=
ot;Helvetica",sans-serif;font-size:13px;font-style:normal;font-variant=
:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decorati=
on:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing=
:0px">static analysis into the language is away to keep it modern and relev=
ant, especially, considering C++ very static language and has a lot of comp=
ile-time information the tools can work with.</span></div><div><br></div><d=
iv>Any answers and thoughts are welcome.</div><div><br></div><div>Now on a =
concrete idea - to <b>use <span style=3D"text-align:left;color:rgb(34,34,34=
);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:&qu=
ot;Arial","Helvetica",sans-serif;font-size:13px;font-style:n=
ormal;font-variant:normal;text-decoration:none;word-spacing:0px;display:inl=
ine!important;white-space:normal;float:none;background-color:transparent">s=
tatic analysis to make *_view classes safe(er)</span>.</b><b><br></b></div>=
</div></blockquote><div><br></div><div>This is the wrong tool for the job. =
The ideal solution is to make such code <i>ill formed</i>, not to rely on &=
quot;static analysis" to make compilers give a warning or something.</=
div><div><br></div><div>Or better yet, to change the language to make such =
code <i>functional</i>. After all, if you're going to go through the ef=
fort of tagging a function with this attribute, why not tag it with a keywo=
rd that extends the lifetime of the temporary correctly?</div><div><br></di=
v><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187);=
word-wrap: break-word; background-color: rgb(250, 250, 250);"><code class=
=3D"prettyprint"><div class=3D"subprettyprint"><span class=3D"styled-by-pre=
ttify" style=3D"color: #000;">A_view</span><span class=3D"styled-by-prettif=
y" style=3D"color: #660;">(</span><span class=3D"styled-by-prettify" style=
=3D"color: #000;">extend A</span><span class=3D"styled-by-prettify" style=
=3D"color: #660;">&&</span><span class=3D"styled-by-prettify" style=
=3D"color: #000;"> arg</span><span class=3D"styled-by-prettify" style=3D"co=
lor: #660;">)</span><span class=3D"styled-by-prettify" style=3D"color: #000=
;"> </span><span class=3D"styled-by-prettify" style=3D"color: #660;">:</spa=
n><span class=3D"styled-by-prettify" style=3D"color: #000;"> _a</span><span=
class=3D"styled-by-prettify" style=3D"color: #660;">(&</span><span cla=
ss=3D"styled-by-prettify" style=3D"color: #000;">arg</span><span class=3D"s=
tyled-by-prettify" style=3D"color: #660;">)</span><span class=3D"styled-by-=
prettify" style=3D"color: #000;"> </span><span class=3D"styled-by-prettify"=
style=3D"color: #660;">{}</span><span class=3D"styled-by-prettify" style=
=3D"color: #000;"><br><br></span><span class=3D"styled-by-prettify" style=
=3D"color: #660;">...</span><span class=3D"styled-by-prettify" style=3D"col=
or: #000;"><br><br>A_view </span><span class=3D"styled-by-prettify" style=
=3D"color: #008;">ref</span><span class=3D"styled-by-prettify" style=3D"col=
or: #660;">(</span><span class=3D"styled-by-prettify" style=3D"color: #000;=
">A</span><span class=3D"styled-by-prettify" style=3D"color: #660;">{});</s=
pan><span class=3D"styled-by-prettify" style=3D"color: #000;"> </span><span=
class=3D"styled-by-prettify" style=3D"color: #800;">//A{}'s lifetime i=
s extended to that of the declaration's enclosing scope.</span><span cl=
ass=3D"styled-by-prettify" style=3D"color: #000;"><br></span></div></code><=
/div><div><br></div><div><br></div><div><br></div><div><br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: =
1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><b></b></div><div>=
Here is a suggestion:</div><div><br></div><div><font face=3D"courier new,mo=
nospace">struct A_view</font></div><div><font face=3D"courier new,monospace=
">{</font></div><div><font face=3D"courier new,monospace">=C2=A0 A_view( [[=
dependent_lifetime]]=C2=A0 A&& arg) : _a(&arg) {}</font></div><=
div><font face=3D"courier new,monospace">=C2=A0 A* _a;</font></div><div><fo=
nt face=3D"courier new,monospace">};</font></div><div><font face=3D"courier=
new,monospace"><br></font></div><div>Now, given the code above using A_vie=
w, after ~A() is called on the variable arg points to. will be marked as an=
error:</div><div><br></div><div><font face=3D"courier new,monospace">A_vie=
w ref(A{}); //< OK, no use of ref</font></div><div><font face=3D"courier=
new,monospace"><br></font></div><div><span style=3D"text-align:left;color:=
rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;fon=
t-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-deco=
ration:none;word-spacing:0px;display:inline!important;white-space:normal;fl=
oat:none;background-color:transparent"><font face=3D"courier new,monospace"=
>A_view (A{}).func(); //< OK , A outlives ref</font></span></div><div><s=
pan style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-i=
ndent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-varia=
nt:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inl=
ine!important;white-space:normal;float:none;background-color:transparent"><=
font face=3D"courier new,monospace"><br></font></span></div><div><span styl=
e=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0p=
x;letter-spacing:normal;font-size:13px;font-variant:normal;word-spacing:0px=
;display:inline!important;white-space:normal;float:none;background-color:tr=
ansparent"><span style=3D"text-align:left;color:rgb(34,34,34);text-transfor=
m:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:norm=
al;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0p=
x;display:inline!important;white-space:normal;float:none;background-color:t=
ransparent"><font face=3D"courier new,monospace">A_view ref(A{});</font></s=
pan></span></div><div><font face=3D"courier new,monospace">ref<span style=
=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px=
;letter-spacing:normal;font-size:13px;font-variant:normal;word-spacing:0px;=
display:inline!important;white-space:normal;float:none;background-color:tra=
nsparent"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform=
:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:norma=
l;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px=
;display:inline!important;white-space:normal;float:none;background-color:tr=
ansparent">.func(); //< error/warning, ref used after A is destroyed</sp=
an></span></font></div><div><font face=3D"courier new,monospace"><span styl=
e=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0p=
x;letter-spacing:normal;font-size:13px;font-variant:normal;word-spacing:0px=
;display:inline!important;white-space:normal;float:none;background-color:tr=
ansparent"><span style=3D"text-align:left;color:rgb(34,34,34);text-transfor=
m:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:norm=
al;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0p=
x;display:inline!important;white-space:normal;float:none;background-color:t=
ransparent"><br></span></span></font></div><div><span style=3D"text-align:l=
eft;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:=
normal;font-size:13px;font-variant:normal;word-spacing:0px;display:inline!i=
mportant;white-space:normal;float:none;background-color:transparent"><span =
style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-inden=
t:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-variant:n=
ormal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline!=
important;white-space:normal;float:none;background-color:transparent"><font=
face=3D"arial,sans-serif">I believed this can be enforced by <i>any</i> co=
mpiler, as<i> long as </i>these limitations apply.</font></span></span></di=
v><div>1) A_view is not heap allocated=C2=A0</div><div>2) We forbid <b>all<=
/b> uses of <font face=3D"courier new,monospace">ref</font>, not just uses =
involving _a;</div><div><br></div><div>These two limitations are there to a=
void tracking lifetime through pointers.</div><div><br></div><div>Lifetime =
contract is exclusively b/w <font face=3D"courier new,monospace">ref </font=
><font face=3D"arial,sans-serif">and</font><font face=3D"courier new,monosp=
ace"> *(&arg).=C2=A0</font></div><div><font face=3D"arial,sans-serif">C=
onsidering the compiler is responsible to destroy both of these, it <i>shou=
ld</i> be possible to give a error/warning if variable <font face=3D"courie=
r new,monospace">ref</font> is used after variable=C2=A0<span style=3D"disp=
lay:inline!important;float:none;background-color:transparent;color:rgb(34,3=
4,34);font-family:courier new,monospace;font-size:13px;font-style:normal;fo=
nt-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;tex=
t-decoration:none;text-indent:0px;text-transform:none;white-space:normal;wo=
rd-spacing:0px">*(&arg)<font face=3D"arial,sans-serif"> </font><font fa=
ce=3D"arial,sans-serif">is destroyed.</font></span></font></div><div><font =
face=3D"arial,sans-serif">Copies of <font face=3D"courier new,monospace">re=
f</font> do not contribute to lifetime tracking - assumed is the view outli=
ves the viewed the same way it is assumed when the view is created from a n=
on-rvalue.</font><font face=3D"arial,sans-serif"><i><b></b></i></font></div=
><div><b><i><font face=3D"arial,sans-serif"><br></font></i></b></div><div><=
font face=3D"arial,sans-serif">Comments are more then welcome, both on the =
broader topic about mandating static analysis and the concrete proposal.</f=
ont></div><div><br></div><div>Thanks=C2=A0</div><div>Mihail Naydenov</div><=
/div></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/4270ffec-ccc7-4abd-836d-213db296be84%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4270ffec-ccc7-4abd-836d-213db296be84=
%40isocpp.org</a>.<br />
------=_Part_2966_810626191.1515945825172--
------=_Part_2965_1898407645.1515945825171--
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Sun, 14 Jan 2018 16:06:44 +0000
Raw View
--001a113b0938244c820562beaf67
Content-Type: text/plain; charset="UTF-8"
I don't think the idea is to force users to do it, but to force compilers
to do it. It's essentially the same as deprecating various forms of
undefined behaviour, which in turn forces compilers to become smarter.
My position on this is constantly evolving. On one hand it's nice to have a
language that doesn't allow developers to screw up. On the other hand, it's
also nice to allow users to have more control (which is why
std::unreachable is favourable to me, so that people only get more control
when they ask for it).
I do not believe it is reasonable to *demand* compilers check for such
things simply because it isn't currently reasonable to demand users to do
such things. I do, however, think it'd be very useful for every teacher of
C++ (From tutorials to books to actual teachers) to explicitly teach people
what tools are available to them. When I first started out with C++, I made
so many dumb mistakes that took a long time to figure out. Sure that
process made me a better developer, but it would have been a lot easier had
my toolset been better than valgrind and gdb. Now we have all of these
shiny sanitisers, we should mandate that new users have them drilled into
their heads. In fact, I'd go as far as saying we should probably have a set
of standards for C++ teaching material (I'm not sure if that's a thing).
On 14 Jan 2018 15:51, "Andrey Semashev" <andrey.semashev@gmail.com> wrote:
On 01/14/18 16:40, mihailnajdenov@gmail.com wrote:
> Hello,
> In recent years there is a boom of static analysis - from new languages
> like Rust and Swift to the powerful tools, provided by C++ compilers.
>
> However I don't see it C++ language /mandating/ any of these. I have a
> question - is this something the committee is looking into? Is there a
> working group for this?
>
> If a tool is a lifesaver, why is it not mandatory - who does not what to
> save lifes?
>
> I strongly believe bringing more (any?) static analysis into the language
> is away to keep it modern and relevant, especially, considering C++ very
> static language and has a lot of compile-time information the tools can
> work with.
>
> Any answers and thoughts are welcome.
>
How does *mandating* a particular tool help language users? If you can use
a tool right now, why do you want to enforce it on everyone?
Also, what should we do about the platforms where such tools are not
available?
--
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.
To view this discussion on the web visit https://groups.google.com/a/is
ocpp.org/d/msgid/std-proposals/3d1ee12f-b97a-f259-b98a-
831153b4245e%40gmail.com.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCPnXD65H1sy_Zsx%3DYWDzhfhhSr8KAeQ6emU0f69%2Bu%3D%2B7Q%40mail.gmail.com.
--001a113b0938244c820562beaf67
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><div>I don't think the idea is to force users to do i=
t, but to force compilers to do it. It's essentially the same as deprec=
ating various forms of undefined behaviour, which in turn forces compilers =
to become smarter.</div><div dir=3D"auto"><br></div><div dir=3D"auto">My po=
sition on this is constantly evolving. On one hand it's nice to have a =
language that doesn't allow developers to screw up. On the other hand, =
it's also nice to allow users to have more control (which is why std::u=
nreachable is favourable to me, so that people only get more control when t=
hey ask for it).</div><div dir=3D"auto"><br></div><div dir=3D"auto">I do no=
t believe it is reasonable to *demand* compilers check for such things simp=
ly because it isn't currently reasonable to demand users to do such thi=
ngs. I do, however, think it'd be very useful for every teacher of C++ =
(From tutorials to books to actual teachers) to explicitly teach people wha=
t tools are available to them. When I first started out with C++, I made so=
many dumb mistakes that took a long time to figure out. Sure that process =
made me a better developer, but it would have been a lot easier had my tool=
set been better than valgrind and gdb. Now we have all of these shiny sanit=
isers, we should mandate that new users have them drilled into their heads.=
In fact, I'd go as far as saying we should probably have a set of stan=
dards for C++ teaching material (I'm not sure if that's a thing).<b=
r><div class=3D"gmail_extra" dir=3D"auto"><br><div class=3D"gmail_quote">On=
14 Jan 2018 15:51, "Andrey Semashev" <<a href=3D"mailto:andre=
y.semashev@gmail.com">andrey.semashev@gmail.com</a>> wrote:<br type=3D"a=
ttribution"><blockquote class=3D"quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div class=3D"quoted-text">On 01/14/18=
16:40, <a href=3D"mailto:mihailnajdenov@gmail.com" target=3D"_blank">mihai=
lnajdenov@gmail.com</a> wrote:<br>
</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div class=3D"quoted-text">
Hello,<br>
In recent years there is a boom of static analysis - from new languages lik=
e Rust and Swift to the powerful tools, provided by C++ compilers.<br>
<br></div>
However I don't see it C++ language /mandating/ any of these. I have a =
question - is this something the committee is looking into? Is there a work=
ing group for this?<div class=3D"quoted-text"><br>
If a tool is a lifesaver, why is it not mandatory - who does not what to sa=
ve lifes?<br>
<br>
I strongly believe bringing more (any?) static analysis into the language i=
s away to keep it modern and relevant, especially, considering C++ very sta=
tic language and has a lot of compile-time information the tools can work w=
ith.<br>
<br>
Any answers and thoughts are welcome.<br>
</div></blockquote>
<br>
How does *mandating* a particular tool help language users? If you can use =
a tool right now, why do you want to enforce it on everyone?<br>
<br>
Also, what should we do about the platforms where such tools are not availa=
ble?<div class=3D"quoted-text"><br>
<br>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isoc<wbr>pp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/3d1ee12f-b97a-f259-b98a-831153b4245e%=
40gmail.com" rel=3D"noreferrer" target=3D"_blank">https://groups.google.com=
/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/3d1ee12f-b97a-f259-b98a-<wbr>=
831153b4245e%40gmail.com</a>.<br>
</blockquote></div><br></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCPnXD65H1sy_Zsx%3DYWDzhfhhSr8=
KAeQ6emU0f69%2Bu%3D%2B7Q%40mail.gmail.com?utm_medium=3Demail&utm_source=3Df=
ooter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0=
CCPnXD65H1sy_Zsx%3DYWDzhfhhSr8KAeQ6emU0f69%2Bu%3D%2B7Q%40mail.gmail.com</a>=
..<br />
--001a113b0938244c820562beaf67--
.
Author: mihailnajdenov@gmail.com
Date: Sun, 14 Jan 2018 08:15:45 -0800 (PST)
Raw View
------=_Part_2614_1855395153.1515946545578
Content-Type: multipart/alternative;
boundary="----=_Part_2615_348166352.1515946545578"
------=_Part_2615_348166352.1515946545578
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 14, 2018 at 5:51:04 PM UTC+2, Andrey Semashev wrote:
>
> ...
>
> How does *mandating* a particular tool help language users? If you can
> use a tool right now, why do you want to enforce it on everyone?
>
Because enforcing it creates better programs for everyone. Not enforcing it
leaves it to seasoned developers only - people going to cppcon etc.
Of course it will not be a wildcard, just focused uses of it.
>
> Also, what should we do about the platforms where such tools are not
> available?
>
They will have worse (less) warning messages. Of course it is up to the
standard and compiler writers to decide. The bar can be set very low in
terms of complexity.
The point is to have something, which is better then nothing.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/63f911aa-32dc-4c04-ac4a-c3c28cc2d0a9%40isocpp.org.
------=_Part_2615_348166352.1515946545578
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, January 14, 2018 at 5:51:04 PM UTC+2, A=
ndrey Semashev wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">...<br>
<br>How does *mandating* a particular tool help language users? If you can=
=20
<br>use a tool right now, why do you want to enforce it on everyone?
<br></blockquote><div><br></div><div>Because enforcing it creates better pr=
ograms for everyone. Not enforcing it leaves it to seasoned developers only=
- people going to cppcon etc.</div><div>Of course it will not be a wildcar=
d, just focused uses of it.=C2=A0</div><div>=C2=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;">
<br>Also, what should we do about the platforms where such tools are not=20
<br>available?
<br></blockquote><div><br></div><div>They will have worse (less) warning me=
ssages. Of course it is up to the standard and compiler writers to decide. =
The bar can be set very low in terms of complexity.</div><div>The point is =
to have something, which is better then nothing.<br></div><div>=C2=A0</div>=
</div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/63f911aa-32dc-4c04-ac4a-c3c28cc2d0a9%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/63f911aa-32dc-4c04-ac4a-c3c28cc2d0a9=
%40isocpp.org</a>.<br />
------=_Part_2615_348166352.1515946545578--
------=_Part_2614_1855395153.1515946545578--
.
Author: Richard Hodges <hodges.r@gmail.com>
Date: Sun, 14 Jan 2018 17:24:54 +0100
Raw View
--001a113fbfc6187d0c0562bef0f7
Content-Type: text/plain; charset="UTF-8"
> This discussion will be pointless until C++ decides what it should do
when built-in static analysers discover undefined behaviour.
It's obvious to anyone but the isocpp committee what it should do. It
should fail to compile and issue a meaningful diagnostic, whenever
possible, for any and all UB unless that UB has been specifically opted-in
through pragmas and/or attributes.
Any other course of action is indefensible.
On 14 January 2018 at 16:39, j c <james.a.cooper@gmail.com> wrote:
> This discussion will be pointless until C++ decides what it should do when
> built-in static analysers discover undefined behaviour.
> Right now they use it as an excuse to generate heavily optimised, but
> ultimately incorrect, programs instead of just bailing out of the compile.
>
>
> On Sunday, January 14, 2018, <mihailnajdenov@gmail.com> wrote:
>
>> Hello,
>> In recent years there is a boom of static analysis - from new languages
>> like Rust and Swift to the powerful tools, provided by C++ compilers.
>>
>> However I don't see it C++ language *mandating* any of these. I have a
>> question - is this something the committee is looking into? Is there a
>> working group for this?
>> If a tool is a lifesaver, why is it not mandatory - who does not what to
>> save lifes?
>>
>> I strongly believe bringing more (any?) static analysis into the
>> language is away to keep it modern and relevant, especially, considering
>> C++ very static language and has a lot of compile-time information the
>> tools can work with.
>>
>> Any answers and thoughts are welcome.
>>
>> Now on a concrete idea - to *use static analysis to make *_view classes
>> safe(er).*
>>
>> Here is a suggestion:
>>
>> struct A_view
>> {
>> A_view( [[dependent_lifetime]] A&& arg) : _a(&arg) {}
>> A* _a;
>> };
>>
>> Now, given the code above using A_view, after ~A() is called on the
>> variable arg points to. will be marked as an error:
>>
>> A_view ref(A{}); //< OK, no use of ref
>>
>> A_view (A{}).func(); //< OK , A outlives ref
>>
>> A_view ref(A{});
>> ref.func(); //< error/warning, ref used after A is destroyed
>>
>> I believed this can be enforced by *any* compiler, as* long as *these
>> limitations apply.
>> 1) A_view is not heap allocated
>> 2) We forbid *all* uses of ref, not just uses involving _a;
>>
>> These two limitations are there to avoid tracking lifetime through
>> pointers.
>>
>> Lifetime contract is exclusively b/w ref and *(&arg).
>> Considering the compiler is responsible to destroy both of these, it
>> *should* be possible to give a error/warning if variable ref is used
>> after variable *(&arg) is destroyed.
>> Copies of ref do not contribute to lifetime tracking - assumed is the
>> view outlives the viewed the same way it is assumed when the view is
>> created from a non-rvalue.
>>
>> Comments are more then welcome, both on the broader topic about mandating
>> static analysis and the concrete proposal.
>>
>> Thanks
>> Mihail Naydenov
>>
>> --
>> 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.
>> To view this discussion on the web visit https://groups.google.com/a/is
>> ocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-
>> 5bfaf0af62ca%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJ
> VsW8Yn5LRgzAyc0abLiyQ%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJVsW8Yn5LRgzAyc0abLiyQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hYc2dwGc%3DU7N7tcnaFpk6Wa-vhNeAgrhQ%3DqCCciF_G9-A%40mail.gmail.com.
--001a113fbfc6187d0c0562bef0f7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">>=C2=A0<span style=3D"font-size:12.8px">This discussion=
will be pointless until C++ decides what it should do when built-in static=
analysers discover undefined behaviour.</span><div><span style=3D"font-siz=
e:12.8px"><br></span></div><div><span style=3D"font-size:12.8px">It's o=
bvious to anyone but the isocpp committee=C2=A0what it should do. It should=
fail to compile and issue a meaningful diagnostic, whenever possible, for =
any and all UB unless that UB has been specifically opted-in through pragma=
s and/or attributes.</span></div><div><span style=3D"font-size:12.8px"><br>=
</span></div><div><span style=3D"font-size:12.8px">Any other course of acti=
on is indefensible.</span></div><div><span style=3D"font-size:12.8px"><br><=
/span></div><div><span style=3D"font-size:12.8px"><br></span></div></div><d=
iv class=3D"gmail_extra"><br><div class=3D"gmail_quote">On 14 January 2018 =
at 16:39, j c <span dir=3D"ltr"><<a href=3D"mailto:james.a.cooper@gmail.=
com" target=3D"_blank">james.a.cooper@gmail.com</a>></span> wrote:<br><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex">This discussion will be pointless until C++ de=
cides what it should do when built-in static analysers discover undefined b=
ehaviour.<div>Right now they use it as an excuse to generate heavily optimi=
sed, but ultimately incorrect, programs instead of just bailing out of the =
compile.<div><div class=3D"h5"><br><br>On Sunday, January 14, 2018, <<a=
href=3D"mailto:mihailnajdenov@gmail.com" target=3D"_blank">mihailnajdenov@=
gmail.com</a>> wrote:<br><blockquote class=3D"gmail_quote" style=3D"marg=
in:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"=
><div>Hello, </div><div>In recent years there is a boom of static analysis =
- from new languages like Rust and Swift to the powerful tools, provided by=
C++ compilers.</div><div><br></div><div>However I don't see it C++ lan=
guage <i>mandating</i> any of these. I have a question - is this something =
the committee is looking into? Is there a working group for this?=C2=A0</di=
v><div>If a tool is a lifesaver, why is it not mandatory - who does not wha=
t to save lifes?</div><div><br></div><div>I strongly believe bringing more =
(any?) <span style=3D"display:inline!important;float:none;background-color:=
transparent;color:rgb(34,34,34);font-family:"Arial","Helveti=
ca",sans-serif;font-size:13px;font-style:normal;font-variant:normal;fo=
nt-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;te=
xt-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">stat=
ic analysis into the language is away to keep it modern and relevant, espec=
ially, considering C++ very static language and has a lot of compile-time i=
nformation the tools can work with.</span></div><div><br></div><div>Any ans=
wers and thoughts are welcome.</div><div><br></div><div>Now on a concrete i=
dea - to <b>use <span style=3D"text-align:left;color:rgb(34,34,34);text-tra=
nsform:none;text-indent:0px;letter-spacing:normal;font-family:"Arial&q=
uot;,"Helvetica",sans-serif;font-size:13px;font-style:normal;font=
-variant:normal;text-decoration:none;word-spacing:0px;display:inline!import=
ant;white-space:normal;float:none;background-color:transparent">static anal=
ysis to make *_view classes safe(er)</span>.</b></div><div><b><br></b></div=
><div>Here is a suggestion:</div><div><br></div><div><font face=3D"courier =
new,monospace">struct A_view</font></div><div><font face=3D"courier new,mon=
ospace">{</font></div><div><font face=3D"courier new,monospace">=C2=A0 A_vi=
ew( [[dependent_lifetime]]=C2=A0 A&& arg) : _a(&arg) {}</font><=
/div><div><font face=3D"courier new,monospace">=C2=A0 A* _a;</font></div><d=
iv><font face=3D"courier new,monospace">};</font></div><div><font face=3D"c=
ourier new,monospace"><br></font></div><div>Now, given the code above using=
A_view, after ~A() is called on the variable arg points to. will be marked=
as an error:</div><div><br></div><div><font face=3D"courier new,monospace"=
>A_view ref(A{}); //< OK, no use of ref</font></div><div><font face=3D"c=
ourier new,monospace"><br></font></div><div><span style=3D"text-align:left;=
color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:norm=
al;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;tex=
t-decoration:none;word-spacing:0px;display:inline!important;white-space:nor=
mal;float:none;background-color:transparent"><font face=3D"courier new,mono=
space">A_view (A{}).func(); //< OK , A outlives ref</font></span></div><=
div><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;=
text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font=
-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;displ=
ay:inline!important;white-space:normal;float:none;background-color:transpar=
ent"><font face=3D"courier new,monospace"><br></font></span></div><div><spa=
n style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-ind=
ent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;word-spaci=
ng:0px;display:inline!important;white-space:normal;float:none;background-co=
lor:transparent"><span style=3D"text-align:left;color:rgb(34,34,34);text-tr=
ansform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-styl=
e:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spac=
ing:0px;display:inline!important;white-space:normal;float:none;background-c=
olor:transparent"><font face=3D"courier new,monospace">A_view ref(A{});</fo=
nt></span></span></div><div><font face=3D"courier new,monospace">ref<span s=
tyle=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent=
:0px;letter-spacing:normal;font-size:13px;font-variant:normal;word-spacing:=
0px;display:inline!important;white-space:normal;float:none;background-color=
:transparent"><span style=3D"text-align:left;color:rgb(34,34,34);text-trans=
form:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:n=
ormal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing=
:0px;display:inline!important;white-space:normal;float:none;background-colo=
r:transparent">.func(); //< error/warning, ref used after A is destroyed=
</span></span></font></div><div><font face=3D"courier new,monospace"><span =
style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-inden=
t:0px;letter-spacing:normal;font-size:13px;font-variant:normal;word-spacing=
:0px;display:inline!important;white-space:normal;float:none;background-colo=
r:transparent"><span style=3D"text-align:left;color:rgb(34,34,34);text-tran=
sform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:=
normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacin=
g:0px;display:inline!important;white-space:normal;float:none;background-col=
or:transparent"><br></span></span></font></div><div><span style=3D"text-ali=
gn:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spac=
ing:normal;font-size:13px;font-variant:normal;word-spacing:0px;display:inli=
ne!important;white-space:normal;float:none;background-color:transparent"><s=
pan style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-i=
ndent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-varia=
nt:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inl=
ine!important;white-space:normal;float:none;background-color:transparent"><=
font face=3D"arial,sans-serif">I believed this can be enforced by <i>any</i=
> compiler, as<i> long as </i>these limitations apply.</font></span></span>=
</div><div>1) A_view is not heap allocated=C2=A0</div><div>2) We forbid <b>=
all</b> uses of <font face=3D"courier new,monospace">ref</font>, not just u=
ses involving _a;</div><div><br></div><div>These two limitations are there =
to avoid tracking lifetime through pointers.</div><div><br></div><div>Lifet=
ime contract is exclusively b/w <font face=3D"courier new,monospace">ref </=
font><font face=3D"arial,sans-serif">and</font><font face=3D"courier new,mo=
nospace"> *(&arg).=C2=A0</font></div><div><font face=3D"arial,sans-seri=
f">Considering the compiler is responsible to destroy both of these, it <i>=
should</i> be possible to give a error/warning if variable <font face=3D"co=
urier new,monospace">ref</font> is used after variable=C2=A0<span style=3D"=
display:inline!important;float:none;background-color:transparent;color:rgb(=
34,34,34);font-family:courier new,monospace;font-size:13px;font-style:norma=
l;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left=
;text-decoration:none;text-indent:0px;text-transform:none;white-space:norma=
l;word-spacing:0px">*(&arg)<font face=3D"arial,sans-serif"> </font><fon=
t face=3D"arial,sans-serif">is destroyed.</font></span></font></div><div><f=
ont face=3D"arial,sans-serif">Copies of <font face=3D"courier new,monospace=
">ref</font> do not contribute to lifetime tracking - assumed is the view o=
utlives the viewed the same way it is assumed when the view is created from=
a non-rvalue.</font><font face=3D"arial,sans-serif"><i><b></b></i></font><=
/div><div><b><i><font face=3D"arial,sans-serif"><br></font></i></b></div><d=
iv><font face=3D"arial,sans-serif">Comments are more then welcome, both on =
the broader topic about mandating static analysis and the concrete proposal=
..</font></div><div><br></div><div>Thanks=C2=A0</div><div>Mihail Naydenov</d=
iv></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@isoc<wbr>pp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/0087c1a4-0b36-40ca-8d43-5bfaf0af62ca%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/0087=
c1a4-0b36-40ca-8d43-<wbr>5bfaf0af62ca%40isocpp.org</a>.<br>
</blockquote></div></div></div><div><div class=3D"h5">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></div></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJVsW8Yn5=
LRgzAyc0abLiyQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-=
<wbr>proposals/<wbr>CAFQaeCDQyFB8zoRoBzBJsjQGUi2wJ<wbr>VsW8Yn5LRgzAyc0abLiy=
Q%40mail.<wbr>gmail.com</a>.<br>
</blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALvx3hYc2dwGc%3DU7N7tcnaFpk6Wa-vhNeA=
grhQ%3DqCCciF_G9-A%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hYc2dwG=
c%3DU7N7tcnaFpk6Wa-vhNeAgrhQ%3DqCCciF_G9-A%40mail.gmail.com</a>.<br />
--001a113fbfc6187d0c0562bef0f7--
.
Author: mihailnajdenov@gmail.com
Date: Sun, 14 Jan 2018 08:34:41 -0800 (PST)
Raw View
------=_Part_2705_599375530.1515947682020
Content-Type: multipart/alternative;
boundary="----=_Part_2706_1189767133.1515947682021"
------=_Part_2706_1189767133.1515947682021
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:
>
> ...
>
> Static analysis is for looking at what is valid language and deciding
> whether or not it's likely that the behavior your code gets is the behavior
> you actually wanted.
>
Isn't that precisely the example I gave? A valid language, not doing what
one wanted?
Only difference, the standard should say the implementation should warn the
user if this and that.
> If you make a change to the language, you aren't "using static analysis";
> you've made something *linguistically* impossible.
>
> It's like the difference between saying "we shouldn't swear" vs. removing
> swear words from the English language entirely.
>
> Whether compilers include static analysis tools, and how they are used, is
> out-of-bounds for the standard. Though you could think of contracts as a
> mechanism to make static analysis easier, that's more a useful additional
> thing that contracts do.
>
> I have a question - is this something the committee is looking into? Is
>> there a working group for this?
>> If a tool is a lifesaver, why is it not mandatory - who does not what to
>> save lifes?
>>
>> I strongly believe bringing more (any?) static analysis into the
>> language is away to keep it modern and relevant, especially, considering
>> C++ very static language and has a lot of compile-time information the
>> tools can work with.
>>
>> Any answers and thoughts are welcome.
>>
>> Now on a concrete idea - to *use static analysis to make *_view classes
>> safe(er).*
>>
>
> This is the wrong tool for the job. The ideal solution is to make such
> code *ill formed*, not to rely on "static analysis" to make compilers
> give a warning or something.
>
> Or better yet, to change the language to make such code *functional*.
> After all, if you're going to go through the effort of tagging a function
> with this attribute, why not tag it with a keyword that extends the
> lifetime of the temporary correctly?
>
> A_view(extend A&& arg) : _a(&arg) {}
>
> ...
>
> A_view ref(A{}); //A{}'s lifetime is extended to that of the
> declaration's enclosing scope.
>
>
This is infinitely more complex to implement however, also makes semantic
change to the language (hence it can not be attribute).
But more impartially, what do you rally need it?
Do you really need the lifetime extended, when one could just decl A before
view? We are worried about errors and shots in the food, I doubt we need
the extra functionality, considering the complexity.
(I might be wrong, I also considered [[extends_lifetime]] but discarded
because the above reasons)
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/08cecc11-e902-4542-a827-53dc45a125d5%40isocpp.org.
------=_Part_2706_1189767133.1515947682021
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, N=
icol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr">...<div></div><div><br></div><div>Static analysis is for looking at wha=
t is valid language and deciding whether or not it's likely that the be=
havior your code gets is the behavior you actually wanted.</div></div></blo=
ckquote><div><br></div><div>Isn't that precisely the example I gave? A =
valid language, not doing what one wanted?=C2=A0</div><div>Only difference,=
the standard should say the implementation should warn the user if this an=
d that.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">=
<div dir=3D"ltr"><div> If you make a change to the language, you aren't=
"<span style=3D"display:inline!important;float:none;background-color:=
transparent;color:rgb(34,34,34);font-family:"Arial","Helveti=
ca",sans-serif;font-size:13px;font-style:normal;font-variant:normal;fo=
nt-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;te=
xt-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">usin=
g </span>static analysis"; you've made something <i>linguistically=
</i> impossible.</div><div><br></div><div>It's like the difference betw=
een saying "we shouldn't swear" vs. removing swear words from=
the English language entirely.</div><div><br></div><div>Whether compilers =
include static analysis tools, and how they are used, is out-of-bounds for =
the standard. Though you could think of contracts as a mechanism to make st=
atic analysis easier, that's more a useful additional thing that contra=
cts do.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr"><div>I have a question - is this something the committee is looki=
ng into? Is there a working group for this?=C2=A0</div><div>If a tool is a =
lifesaver, why is it not mandatory - who does not what to save lifes?</div>=
<div><br></div><div>I strongly believe bringing more (any?) <span style=3D"=
display:inline!important;float:none;background-color:transparent;color:rgb(=
34,34,34);font-family:"Arial","Helvetica",sans-serif;fo=
nt-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter-s=
pacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-tra=
nsform:none;white-space:normal;word-spacing:0px">static analysis into the l=
anguage is away to keep it modern and relevant, especially, considering C++=
very static language and has a lot of compile-time information the tools c=
an work with.</span></div><div><br></div><div>Any answers and thoughts are =
welcome.</div><div><br></div><div>Now on a concrete idea - to <b>use <span =
style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-inden=
t:0px;letter-spacing:normal;font-family:"Arial","Helvetica&q=
uot;,sans-serif;font-size:13px;font-style:normal;font-variant:normal;text-d=
ecoration:none;word-spacing:0px;display:inline!important;white-space:normal=
;float:none;background-color:transparent">static analysis to make *_view cl=
asses safe(er)</span>.</b><b><br></b></div></div></blockquote><div><br></di=
v><div>This is the wrong tool for the job. The ideal solution is to make su=
ch code <i>ill formed</i>, not to rely on "static analysis" to ma=
ke compilers give a warning or something.</div><div><br></div><div>Or bette=
r yet, to change the language to make such code <i>functional</i>. After al=
l, if you're going to go through the effort of tagging a function with =
this attribute, why not tag it with a keyword that extends the lifetime of =
the temporary correctly?</div><div><br></div><div style=3D"border:1px solid=
rgb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><=
code><div><span style=3D"color:#000">A_view</span><span style=3D"color:#660=
">(</span><span style=3D"color:#000">extend A</span><span style=3D"color:#6=
60">&&</span><span style=3D"color:#000"> arg</span><span style=3D"c=
olor:#660">)</span><span style=3D"color:#000"> </span><span style=3D"color:=
#660">:</span><span style=3D"color:#000"> _a</span><span style=3D"color:#66=
0">(&</span><span style=3D"color:#000">arg</span><span style=3D"color:#=
660">)</span><span style=3D"color:#000"> </span><span style=3D"color:#660">=
{}</span><span style=3D"color:#000"><br><br></span><span style=3D"color:#66=
0">...</span><span style=3D"color:#000"><br><br>A_view </span><span style=
=3D"color:#008">ref</span><span style=3D"color:#660">(</span><span style=3D=
"color:#000">A</span><span style=3D"color:#660">{});</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#800">//A{}'s lifetime is exten=
ded to that of the declaration's enclosing scope.</span><span style=3D"=
color:#000"><br></span></div></code></div><div><br></div></div></blockquote=
><div><br></div><div>This is infinitely more complex to implement however, =
also makes semantic change to the language (hence it can not be attribute).=
=C2=A0 </div><div>But more impartially, what do you rally need it?</div><di=
v>Do you really need the lifetime extended, when one could just decl A befo=
re view? We are worried about errors and shots in the food, I doubt we need=
the extra functionality, considering the complexity.=C2=A0</div><div><br><=
/div><div>(I might be wrong, I also considered [[extends_lifetime]] but dis=
carded because the above reasons)</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/08cecc11-e902-4542-a827-53dc45a125d5%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/08cecc11-e902-4542-a827-53dc45a125d5=
%40isocpp.org</a>.<br />
------=_Part_2706_1189767133.1515947682021--
------=_Part_2705_599375530.1515947682020--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sun, 14 Jan 2018 11:05:44 -0800 (PST)
Raw View
------=_Part_2888_1495016951.1515956744096
Content-Type: multipart/alternative;
boundary="----=_Part_2889_654526554.1515956744097"
------=_Part_2889_654526554.1515956744097
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, mihailn...@gmail.com
wrote:
>
> On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:
>>
>> ...
>>
>> Static analysis is for looking at what is valid language and deciding
>> whether or not it's likely that the behavior your code gets is the behavior
>> you actually wanted.
>>
>
> Isn't that precisely the example I gave? A valid language, not doing what
> one wanted?
> Only difference, the standard should say the implementation should warn
> the user if this and that.
>
And it's that "difference" that I'm saying shouldn't happen. If you want a
static analyzer to find bugs, that's great. But the standard should not
require it, nor should the standard be getting in the way of that process.
The standard should be about the actual language.
If you make a change to the language, you aren't "using static analysis";
>> you've made something *linguistically* impossible.
>>
>> It's like the difference between saying "we shouldn't swear" vs. removing
>> swear words from the English language entirely.
>>
>> Whether compilers include static analysis tools, and how they are used,
>> is out-of-bounds for the standard. Though you could think of contracts as a
>> mechanism to make static analysis easier, that's more a useful additional
>> thing that contracts do.
>>
>> I have a question - is this something the committee is looking into? Is
>>> there a working group for this?
>>> If a tool is a lifesaver, why is it not mandatory - who does not what to
>>> save lifes?
>>>
>>> I strongly believe bringing more (any?) static analysis into the
>>> language is away to keep it modern and relevant, especially, considering
>>> C++ very static language and has a lot of compile-time information the
>>> tools can work with.
>>>
>>> Any answers and thoughts are welcome.
>>>
>>> Now on a concrete idea - to *use static analysis to make *_view classes
>>> safe(er).*
>>>
>>
>> This is the wrong tool for the job. The ideal solution is to make such
>> code *ill formed*, not to rely on "static analysis" to make compilers
>> give a warning or something.
>>
>> Or better yet, to change the language to make such code *functional*.
>> After all, if you're going to go through the effort of tagging a function
>> with this attribute, why not tag it with a keyword that extends the
>> lifetime of the temporary correctly?
>>
>> A_view(extend A&& arg) : _a(&arg) {}
>>
>> ...
>>
>> A_view ref(A{}); //A{}'s lifetime is extended to that of the
>> declaration's enclosing scope.
>>
>>
> This is infinitely more complex to implement however, also makes semantic
> change to the language (hence it can not be attribute).
> But more impartially, what do you rally need it?
> Do you really need the lifetime extended, when one could just decl A
> before view? We are worried about errors and shots in the food, I doubt we
> need the extra functionality, considering the complexity.
>
You're thinking about it backwards. If people frequently keep writing code
like that, then on some level, they want to write it that way. It's natural
for them to. So you can either slap them in the face and make them stop, or
you can just* make it legal* and make it do what they expect.
Yes, making it legal properly is infinitely harder than just slapping an
attribute on it and calling it a day. But why should C++ keep taking the
easy path to "fixing" its problems?
(I might be wrong, I also considered [[extends_lifetime]] but discarded
> because the above reasons)
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4e25f92e-bd17-42e4-9a33-68916ae380d6%40isocpp.org.
------=_Part_2889_654526554.1515956744097
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, mihailn.=
...@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D=
"ltr">On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:<b=
lockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-=
left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">...<div></div><div><=
br></div><div>Static analysis is for looking at what is valid language and =
deciding whether or not it's likely that the behavior your code gets is=
the behavior you actually wanted.</div></div></blockquote><div><br></div><=
div>Isn't that precisely the example I gave? A valid language, not doin=
g what one wanted?=C2=A0</div><div>Only difference, the standard should say=
the implementation should warn the user if this and that.</div></div></blo=
ckquote><div><br></div><div>And it's that "difference" that I=
'm saying shouldn't happen. If you want a static analyzer to find b=
ugs, that's great. But the standard should not require it, nor should t=
he standard be getting in the way of that process.</div><div><br></div><div=
>The standard should be about the actual language.</div><div><br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div> If you make a change to the l=
anguage, you aren't "<span style=3D"display:inline!important;float=
:none;background-color:transparent;color:rgb(34,34,34);font-family:"Ar=
ial","Helvetica",sans-serif;font-size:13px;font-style:normal=
;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;=
text-decoration:none;text-indent:0px;text-transform:none;white-space:normal=
;word-spacing:0px">using </span>static analysis"; you've made some=
thing <i>linguistically</i> impossible.</div><div><br></div><div>It's l=
ike the difference between saying "we shouldn't swear" vs. re=
moving swear words from the English language entirely.</div><div><br></div>=
<div>Whether compilers include static analysis tools, and how they are used=
, is out-of-bounds for the standard. Though you could think of contracts as=
a mechanism to make static analysis easier, that's more a useful addit=
ional thing that contracts do.</div><div><br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr"><div>I have a question - is this something=
the committee is looking into? Is there a working group for this?=C2=A0</d=
iv><div>If a tool is a lifesaver, why is it not mandatory - who does not wh=
at to save lifes?</div><div><br></div><div>I strongly believe bringing more=
(any?) <span style=3D"display:inline!important;float:none;background-color=
:transparent;color:rgb(34,34,34);font-family:"Arial","Helvet=
ica",sans-serif;font-size:13px;font-style:normal;font-variant:normal;f=
ont-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;t=
ext-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">sta=
tic analysis into the language is away to keep it modern and relevant, espe=
cially, considering C++ very static language and has a lot of compile-time =
information the tools can work with.</span></div><div><br></div><div>Any an=
swers and thoughts are welcome.</div><div><br></div><div>Now on a concrete =
idea - to <b>use <span style=3D"text-align:left;color:rgb(34,34,34);text-tr=
ansform:none;text-indent:0px;letter-spacing:normal;font-family:"Arial&=
quot;,"Helvetica",sans-serif;font-size:13px;font-style:normal;fon=
t-variant:normal;text-decoration:none;word-spacing:0px;display:inline!impor=
tant;white-space:normal;float:none;background-color:transparent">static ana=
lysis to make *_view classes safe(er)</span>.</b><b><br></b></div></div></b=
lockquote><div><br></div><div>This is the wrong tool for the job. The ideal=
solution is to make such code <i>ill formed</i>, not to rely on "stat=
ic analysis" to make compilers give a warning or something.</div><div>=
<br></div><div>Or better yet, to change the language to make such code <i>f=
unctional</i>. After all, if you're going to go through the effort of t=
agging a function with this attribute, why not tag it with a keyword that e=
xtends the lifetime of the temporary correctly?</div><div><br></div><div st=
yle=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;background-co=
lor:rgb(250,250,250)"><code><div><span style=3D"color:#000">A_view</span><s=
pan style=3D"color:#660">(</span><span style=3D"color:#000">extend A</span>=
<span style=3D"color:#660">&&</span><span style=3D"color:#000"> arg=
</span><span style=3D"color:#660">)</span><span style=3D"color:#000"> </spa=
n><span style=3D"color:#660">:</span><span style=3D"color:#000"> _a</span><=
span style=3D"color:#660">(&</span><span style=3D"color:#000">arg</span=
><span style=3D"color:#660">)</span><span style=3D"color:#000"> </span><spa=
n style=3D"color:#660">{}</span><span style=3D"color:#000"><br><br></span><=
span style=3D"color:#660">...</span><span style=3D"color:#000"><br><br>A_vi=
ew </span><span style=3D"color:#008">ref</span><span style=3D"color:#660">(=
</span><span style=3D"color:#000">A</span><span style=3D"color:#660">{});</=
span><span style=3D"color:#000"> </span><span style=3D"color:#800">//A{}=
9;s lifetime is extended to that of the declaration's enclosing scope.<=
/span><span style=3D"color:#000"><br></span></div></code></div><div><br></d=
iv></div></blockquote><div><br></div><div>This is infinitely more complex t=
o implement however, also makes semantic change to the language (hence it c=
an not be attribute).=C2=A0 </div><div>But more impartially, what do you ra=
lly need it?</div><div>Do you really need the lifetime extended, when one c=
ould just decl A before view? We are worried about errors and shots in the =
food, I doubt we need the extra functionality, considering the complexity.<=
/div></div></blockquote><div><br></div><div>You're thinking about it ba=
ckwards. If people frequently keep writing code like that, then on some lev=
el, they want to write it that way. It's natural for them to. So you ca=
n either slap them in the face and make them stop, or you can just<i> make =
it legal</i> and make it do what they expect.</div><div><br></div><div>Yes,=
making it legal properly is infinitely harder than just slapping an attrib=
ute on it and calling it a day. But why should C++ keep taking the easy pat=
h to "fixing" its problems?</div><div><br></div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr"><div>(I might be wrong, I also=
considered [[extends_lifetime]] but discarded because the above reasons)</=
div></div></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/4e25f92e-bd17-42e4-9a33-68916ae380d6%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4e25f92e-bd17-42e4-9a33-68916ae380d6=
%40isocpp.org</a>.<br />
------=_Part_2889_654526554.1515956744097--
------=_Part_2888_1495016951.1515956744096--
.
Author: mihailnajdenov@gmail.com
Date: Sun, 14 Jan 2018 12:44:09 -0800 (PST)
Raw View
------=_Part_3609_526591110.1515962650016
Content-Type: multipart/alternative;
boundary="----=_Part_3610_2072346634.1515962650016"
------=_Part_3610_2072346634.1515962650016
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 14, 2018 at 9:05:44 PM UTC+2, Nicol Bolas wrote:
>
> On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, mihailn...@gmail.com
> wrote:
>>
>> On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:
>>>
>>> ...
>>> ...
>>>
>>
> And it's that "difference" that I'm saying shouldn't happen. If you want a
> static analyzer to find bugs, that's great. But the standard should not
> require it, nor should the standard be getting in the way of that process.
>
> The standard should be about the actual language.
>
Yeah, but things like attributes are not about the language. And that is
OK. If there is an attribute which will help you enforce correct code, why
not have it?
> ...
>
> You're thinking about it backwards. If people frequently keep writing code
> like that, then on some level, they want to write it that way. It's natural
> for them to. So you can either slap them in the face and make them stop, or
> you can just* make it legal* and make it do what they expect.
>
> Yes, making it legal properly is infinitely harder than just slapping an
> attribute on it and calling it a day. But why should C++ keep taking the
> easy path to "fixing" its problems?
>
I don't find the possibility of adding lifetime extensions realistic. I
don't mind it, but I really, really doubt it will ever be added. Is there
any work on in that direction? Have ever been any work on that?
Not that it is without problems - we break our own rules adding that. Yea,
const ref already breaks it, but still. Even semantically is not very
accurate - a view is 'slave' to the viewed, should not control it.
Also, what will happen with heap allocated views? Will they fail to compile
and be illegal?
But as I said, I will not fight against lifetime extensions, I just don't
see them coming. Ever.
Where with said attribute we can *considerably* improve the quality of the
user code, making the foot gun very loud.
Actually I will not be surprised if implementations start doing that by
themselves (warning in cases thy can verify). The question is, why the
initiative should always come from them?
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c568fb1e-3e63-4471-9b4a-7d1e6313c4df%40isocpp.org.
------=_Part_3610_2072346634.1515962650016
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, January 14, 2018 at 9:05:44 PM UTC+2, N=
icol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr">On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, <a>mihailn...@gmail.c=
om</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-lef=
t:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Su=
nday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr">...<div></div><div>...</div></d=
iv></blockquote></div></blockquote><div><br></div><div>And it's that &q=
uot;difference" that I'm saying shouldn't happen. If you want =
a static analyzer to find bugs, that's great. But the standard should n=
ot require it, nor should the standard be getting in the way of that proces=
s.</div></div></blockquote><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr"><div><br></div><div>The standard should be about the actual l=
anguage.</div></div></blockquote><div><br></div><div>Yeah, but things like =
attributes are not about the language. And that is OK. If there is an attri=
bute which will help you enforce correct code, why not have it?=C2=A0</div>=
<div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>...</div><div><br></div><div>You're thinking about it backward=
s. If people frequently keep writing code like that, then on some level, th=
ey want to write it that way. It's natural for them to. So you can eith=
er slap them in the face and make them stop, or you can just<i> make it leg=
al</i> and make it do what they expect.</div><div><br></div><div>Yes, makin=
g it legal properly is infinitely harder than just slapping an attribute on=
it and calling it a day. But why should C++ keep taking the easy path to &=
quot;fixing" its problems?</div></div></blockquote><div><br></div><div=
>I don't find the possibility of adding lifetime extensions realistic.=
=C2=A0 I don't mind it, but I really, really doubt it will ever be adde=
d. Is there any work on in that direction? Have ever been any work on that?=
</div><div><br></div><div>Not that it is without problems - we break our ow=
n rules adding that. Yea, const ref already breaks it, but still. Even sema=
ntically is not very accurate - a view is 'slave' to the viewed, sh=
ould not control it.</div><div>Also, what will happen with heap allocated v=
iews? Will they fail to compile and be illegal?=C2=A0</div><div><br></div><=
div>But as I said, I will not fight against lifetime extensions, I just don=
't see them coming. Ever.</div><div><br></div><div>Where with said attr=
ibute we can <i>considerably</i> improve the quality of the user code, maki=
ng the foot gun very loud. </div><div>Actually I will not be surprised if i=
mplementations start doing that <span style=3D"background-color: transparen=
t; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-=
bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; bo=
rder-image-slice: 100%; border-image-source: none; border-image-width: 1; b=
order-left-color: rgb(34, 34, 34); border-left-style: none; border-left-wid=
th: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; bor=
der-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: =
none; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; float=
: none; font-family: &quot;Arial&quot;,&quot;Helvetica&quot=
;,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; fo=
nt-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0p=
x; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; pad=
ding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; tex=
t-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-st=
roke-width: 0px; white-space: normal; word-spacing: 0px;">by themselves</sp=
an> (warning in cases thy can verify). The question is, why the initiative =
should always come from them?</div><div><i><br></i></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/c568fb1e-3e63-4471-9b4a-7d1e6313c4df%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c568fb1e-3e63-4471-9b4a-7d1e6313c4df=
%40isocpp.org</a>.<br />
------=_Part_3610_2072346634.1515962650016--
------=_Part_3609_526591110.1515962650016--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sun, 14 Jan 2018 15:54:32 -0800 (PST)
Raw View
------=_Part_3827_51230773.1515974072599
Content-Type: multipart/alternative;
boundary="----=_Part_3828_1894541883.1515974072599"
------=_Part_3828_1894541883.1515974072599
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 14, 2018 at 3:44:10 PM UTC-5, mihailn...@gmail.com wrote:
>
>
>
> On Sunday, January 14, 2018 at 9:05:44 PM UTC+2, Nicol Bolas wrote:
>>
>> On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, mihailn...@gmail.com
>> wrote:
>>>
>>> On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:
>>>>
>>>> ...
>>>> ...
>>>>
>>>
>> And it's that "difference" that I'm saying shouldn't happen. If you want
>> a static analyzer to find bugs, that's great. But the standard should not
>> require it, nor should the standard be getting in the way of that process.
>>
>
>> The standard should be about the actual language.
>>
>
> Yeah, but things like attributes are not about the language. And that is
> OK. If there is an attribute which will help you enforce correct code, why
> not have it?
>
If attributes aren't "about the language", then why are they defined* by
the language*? And how do you explain P0840?
....
>>
>> You're thinking about it backwards. If people frequently keep writing
>> code like that, then on some level, they want to write it that way. It's
>> natural for them to. So you can either slap them in the face and make them
>> stop, or you can just* make it legal* and make it do what they expect.
>>
>> Yes, making it legal properly is infinitely harder than just slapping an
>> attribute on it and calling it a day. But why should C++ keep taking the
>> easy path to "fixing" its problems?
>>
>
> I don't find the possibility of adding lifetime extensions realistic. I
> don't mind it, but I really, really doubt it will ever be added. Is there
> any work on in that direction? Have ever been any work on that?
>
Yes there has <http://wg21.link/P0066>. But apparently, EWG didn't consider
the cost of consistent use of such annotations to be worth the fixing of
this problem
<https://botondballo.wordpress.com/2015/11/09/trip-report-c-standards-meeting-in-kona-october-2015/>
..
Not that it is without problems - we break our own rules adding that. Yea,
> const ref already breaks it, but still. Even semantically is not very
> accurate - a view is 'slave' to the viewed, should not control it.
> Also, what will happen with heap allocated views? Will they fail to
> compile and be illegal?
>
> But as I said, I will not fight against lifetime extensions, I just don't
> see them coming. Ever.
>
Where with said attribute we can *considerably* improve the quality of the
> user code, making the foot gun very loud.
>
Except where it doesn't, of course:
auto ptr = make_shared<A_view>(A{});
After a discussion about the "extend me" proposal idea, I investigated the
issues with an annotation-based approach. I concluded that the only way to
make it work would be to add the equivalent of a* third* reference type
(whether you spell it with `&&&` or some keyword or attribute associated
with a reference parameter, the effect is to have a thing which behaves
much like a third kind of reference). Which means you'd have to make
forwarding references work with such a tool... somehow.
Your attribute-based annotation falls into the same trap: once you leave
the immediate scope of the code creating the prvalue, it stops being a
prvalue. So unless the immediate scope knows that the parameter is going to
be used like this, it can't be annotated properly.
Ultimately, I've come to believe that the only reasonable solution is
something like `extend_me`: something which explicitly extends the lifetime
of a temporary, which is the responsibility of the writer of the prvalue
expression to properly use.
Actually I will not be surprised if implementations start doing that by
> themselves (warning in cases thy can verify). The question is, why the
> initiative should always come from them?
>
Because the interaction between two rules of the standard makes this legal
code behave in a way that is unexpected but clearly explicitly specified.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/a4ce1aca-9445-4557-b2d9-478e027bf0a0%40isocpp.org.
------=_Part_3828_1894541883.1515974072599
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, January 14, 2018 at 3:44:10 PM UTC-5, m=
ihailn...@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin=
: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div=
dir=3D"ltr"><br><br>On Sunday, January 14, 2018 at 9:05:44 PM UTC+2, Nicol=
Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-lef=
t:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Su=
nday, January 14, 2018 at 11:34:42 AM UTC-5, <a>mihailn...@gmail.com</a> wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Sunday, Jan=
uary 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:<blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr">...<div></div><div>...</div></div></bloc=
kquote></div></blockquote><div><br></div><div>And it's that "diffe=
rence" that I'm saying shouldn't happen. If you want a static =
analyzer to find bugs, that's great. But the standard should not requir=
e it, nor should the standard be getting in the way of that process.</div><=
/div></blockquote><blockquote class=3D"gmail_quote" style=3D"margin:0;margi=
n-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
<div><br></div><div>The standard should be about the actual language.</div>=
</div></blockquote><div><br></div><div>Yeah, but things like attributes are=
not about the language. And that is OK. If there is an attribute which wil=
l help you enforce correct code, why not have it?=C2=A0</div></div></blockq=
uote><div><br></div><div>If attributes aren't "about the language&=
quot;, then why are they defined<i> by the language</i>? And how do you exp=
lain P0840?</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"=
margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;=
"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0;marg=
in-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"=
><div>...</div><div><br></div><div>You're thinking about it backwards. =
If people frequently keep writing code like that, then on some level, they =
want to write it that way. It's natural for them to. So you can either =
slap them in the face and make them stop, or you can just<i> make it legal<=
/i> and make it do what they expect.</div><div><br></div><div>Yes, making i=
t legal properly is infinitely harder than just slapping an attribute on it=
and calling it a day. But why should C++ keep taking the easy path to &quo=
t;fixing" its problems?</div></div></blockquote><div><br></div><div>I =
don't find the possibility of adding lifetime extensions realistic.=C2=
=A0 I don't mind it, but I really, really doubt it will ever be added. =
Is there any work on in that direction? Have ever been any work on that?</d=
iv></div></blockquote><div><br></div><div><a href=3D"http://wg21.link/P0066=
">Yes there has</a>. But apparently, <a href=3D"https://botondballo.wordpre=
ss.com/2015/11/09/trip-report-c-standards-meeting-in-kona-october-2015/">EW=
G didn't consider the cost of consistent use of such annotations to be =
worth the fixing of this problem</a>.</div><div><br></div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Not that it is without pr=
oblems - we break our own rules adding that. Yea, const ref already breaks =
it, but still. Even semantically is not very accurate - a view is 'slav=
e' to the viewed, should not control it.</div><div>Also, what will happ=
en with heap allocated views? Will they fail to compile and be illegal?=C2=
=A0</div><div><br></div><div>But as I said, I will not fight against lifeti=
me extensions, I just don't see them coming. Ever.</div></div></blockqu=
ote><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; p=
adding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width:=
1px; border-left-style: solid;"></blockquote><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padd=
ing-left: 1ex;"><div dir=3D"ltr"><div>Where with said attribute we can <i>c=
onsiderably</i> improve the quality of the user code, making the foot gun v=
ery loud.</div></div></blockquote><div>=C2=A0</div><div>Except where it doe=
sn't, of course:</div><div><br></div><div class=3D"prettyprint" style=
=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; background=
-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"subp=
rettyprint"><span class=3D"styled-by-prettify" style=3D"color: #008;">auto<=
/span><span class=3D"styled-by-prettify" style=3D"color: #000;"> ptr </span=
><span class=3D"styled-by-prettify" style=3D"color: #660;">=3D</span><span =
class=3D"styled-by-prettify" style=3D"color: #000;"> make_shared</span><spa=
n class=3D"styled-by-prettify" style=3D"color: #660;"><</span><span clas=
s=3D"styled-by-prettify" style=3D"color: #000;">A_view</span><span class=3D=
"styled-by-prettify" style=3D"color: #660;">>(</span><span class=3D"styl=
ed-by-prettify" style=3D"color: #000;">A</span><span class=3D"styled-by-pre=
ttify" style=3D"color: #660;">{});</span><span class=3D"styled-by-prettify"=
style=3D"color: #000;"><br></span></div></code></div><br><div>After a disc=
ussion about the "extend me" proposal idea, I investigated the is=
sues with an annotation-based approach. I concluded that the only way to ma=
ke it work would be to add the equivalent of a<i> third</i> reference type =
(whether you spell it with `&&&` or some keyword or attribute a=
ssociated with a reference parameter, the effect is to have a thing which b=
ehaves much like a third kind of reference). Which means you'd have to =
make forwarding references work with such a tool... somehow.</div><div><br>=
</div><div>Your attribute-based annotation falls into the same trap: once y=
ou leave the immediate scope of the code creating the prvalue, it stops bei=
ng a prvalue. So unless the immediate scope knows that the parameter is goi=
ng to be used like this, it can't be annotated properly.</div><div><br>=
</div><div>Ultimately, I've come to believe that the only reasonable so=
lution is something like `extend_me`: something which explicitly extends th=
e lifetime of a temporary, which is the responsibility of the writer of the=
prvalue expression to properly use.</div><div><br></div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Actually I will not be su=
rprised if implementations start doing that <span>by themselves</span> (war=
ning in cases thy can verify). The question is, why the initiative should a=
lways come from them?</div></div></blockquote><div><br></div><div>Because t=
he interaction between two rules of the standard makes this legal code beha=
ve in a way that is unexpected but clearly explicitly specified.</div><div>=
<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/a4ce1aca-9445-4557-b2d9-478e027bf0a0%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a4ce1aca-9445-4557-b2d9-478e027bf0a0=
%40isocpp.org</a>.<br />
------=_Part_3828_1894541883.1515974072599--
------=_Part_3827_51230773.1515974072599--
.
Author: mihailnajdenov@gmail.com
Date: Mon, 15 Jan 2018 01:27:26 -0800 (PST)
Raw View
------=_Part_3473_221638587.1516008446901
Content-Type: multipart/alternative;
boundary="----=_Part_3474_360892104.1516008446901"
------=_Part_3474_360892104.1516008446901
Content-Type: text/plain; charset="UTF-8"
On Monday, January 15, 2018 at 1:54:32 AM UTC+2, Nicol Bolas wrote:
>
>
>
> On Sunday, January 14, 2018 at 3:44:10 PM UTC-5, mihailn...@gmail.com
> wrote:
>>
>>
>>
>> On Sunday, January 14, 2018 at 9:05:44 PM UTC+2, Nicol Bolas wrote:
>>>
>>> On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, mihailn...@gmail.com
>>> wrote:
>>>>
>>>> On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:
>>>>>
>>>>> ...
>>>>> ...
>>>>>
>>>>
>>> And it's that "difference" that I'm saying shouldn't happen. If you want
>>> a static analyzer to find bugs, that's great. But the standard should not
>>> require it, nor should the standard be getting in the way of that process.
>>>
>>
>>> The standard should be about the actual language.
>>>
>>
>> Yeah, but things like attributes are not about the language. And that is
>> OK. If there is an attribute which will help you enforce correct code, why
>> not have it?
>>
>
> If attributes aren't "about the language", then why are they defined* by
> the language*? And how do you explain P0840?
>
> ...
>>>
>>> You're thinking about it backwards. If people frequently keep writing
>>> code like that, then on some level, they want to write it that way. It's
>>> natural for them to. So you can either slap them in the face and make them
>>> stop, or you can just* make it legal* and make it do what they expect.
>>>
>>> Yes, making it legal properly is infinitely harder than just slapping an
>>> attribute on it and calling it a day. But why should C++ keep taking the
>>> easy path to "fixing" its problems?
>>>
>>
>> I don't find the possibility of adding lifetime extensions realistic. I
>> don't mind it, but I really, really doubt it will ever be added. Is there
>> any work on in that direction? Have ever been any work on that?
>>
>
> Yes there has <http://wg21.link/P0066>. But apparently, EWG didn't
> consider the cost of consistent use of such annotations to be worth the
> fixing of this problem
> <https://botondballo.wordpress.com/2015/11/09/trip-report-c-standards-meeting-in-kona-october-2015/>
> .
>
> Not that it is without problems - we break our own rules adding that. Yea,
>> const ref already breaks it, but still. Even semantically is not very
>> accurate - a view is 'slave' to the viewed, should not control it.
>> Also, what will happen with heap allocated views? Will they fail to
>> compile and be illegal?
>>
>> But as I said, I will not fight against lifetime extensions, I just don't
>> see them coming. Ever.
>>
> Where with said attribute we can *considerably* improve the quality of
>> the user code, making the foot gun very loud.
>>
>
> Except where it doesn't, of course:
>
> auto ptr = make_shared<A_view>(A{});
>
>
You are not fair in your example. I was very specific - the attr will be
ignored for heap allocated views (which are not that widely used, if at
all). In any case an attribute can be ignored - it is just a hint - it is
whole different story if its an language extension.
However, even for heap allocated views it will be *possible* to give a
warning if view is used after A is destroyed, where it is practically
impossible to extend the lifetime of A!
> After a discussion about the "extend me" proposal idea, I investigated the
> issues with an annotation-based approach. I concluded that the only way to
> make it work would be to add the equivalent of a* third* reference type
> (whether you spell it with `&&&` or some keyword or attribute associated
> with a reference parameter, the effect is to have a thing which behaves
> much like a third kind of reference). Which means you'd have to make
> forwarding references work with such a tool... somehow.
>
> Your attribute-based annotation falls into the same trap: once you leave
> the immediate scope of the code creating the prvalue, it stops being a
> prvalue. So unless the immediate scope knows that the parameter is going to
> be used like this, it can't be annotated properly.
>
You have to give me an example, I am not sure I understand the issue.
My logic is very, very simple - as long as we have automatic variables (aka
predictable destruction) the compiler knows *everything* needed to track
improper use, given our specification of improper use.
Temporaries, prvalues these have semantic value to us, but in the end - it
is the compiler just rearranging the calls the dtors. All is visible to him
- he created it.
If we, in this predictable for the compiler world, want a variable marked
so we are informed it is used before another variable from this same
predictable world, I am pretty sure the compiler can do this for us.
The point is, not want *can't* be done (the cases which will not be
possible), but what *can* be done. Covering the trivial cases alone is not
only better then nothing, but will actually amount to 95% of the cases
needed to be covered in the first place.
>
> Ultimately, I've come to believe that the only reasonable solution is
> something like `extend_me`: something which explicitly extends the lifetime
> of a temporary, which is the responsibility of the writer of the prvalue
> expression to properly use.
>
> Actually I will not be surprised if implementations start doing that by
>> themselves (warning in cases thy can verify). The question is, why the
>> initiative should always come from them?
>>
>
> Because the interaction between two rules of the standard makes this legal
> code behave in a way that is unexpected but clearly explicitly specified.
>
Does not change the fact the standard not mandating warnings, it is the
implementation which must take the initiative - warning for assignment in
if statement, warning for no return, for fallthrough, for empty statements,
etc etc. These save lifes for pros and juniors alike.
Ironically all the standard did is a way to turn these warnings off if they
do not match the intend. However, how about the standard turning warnings
on (in cases impl. agree are implementable).
Granted [[deprecated]] is such an example but, that is way too little,
compared to what it is possible.
Sure it is better to make this code illegal, but what if it is not possible
or too hard? As the saying (in my language) goes - [*It is] better [to have
a]sparrow in the hand, then an eagle in the sky.*
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9ec7a895-af7b-43d3-b47a-b7c95ed8660b%40isocpp.org.
------=_Part_3474_360892104.1516008446901
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Monday, January 15, 2018 at 1:54:32 AM UTC+2, N=
icol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><br><br>On Sunday, January 14, 2018 at 3:44:10 PM UTC-5, <a>mihailn...@=
gmail.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
"><br><br>On Sunday, January 14, 2018 at 9:05:44 PM UTC+2, Nicol Bolas wrot=
e:<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"ltr">On Sunday, Janua=
ry 14, 2018 at 11:34:42 AM UTC-5, <a>mihailn...@gmail.com</a> wrote:<blockq=
uote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:=
1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Sunday, January 14, 20=
18 at 6:03:45 PM UTC+2, Nicol Bolas wrote:<blockquote class=3D"gmail_quote"=
style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-lef=
t:1ex"><div dir=3D"ltr">...<div></div><div>...</div></div></blockquote></di=
v></blockquote><div><br></div><div>And it's that "difference"=
that I'm saying shouldn't happen. If you want a static analyzer to=
find bugs, that's great. But the standard should not require it, nor s=
hould the standard be getting in the way of that process.</div></div></bloc=
kquote><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8e=
x;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br></=
div><div>The standard should be about the actual language.</div></div></blo=
ckquote><div><br></div><div>Yeah, but things like attributes are not about =
the language. And that is OK. If there is an attribute which will help you =
enforce correct code, why not have it?=C2=A0</div></div></blockquote><div><=
br></div><div>If attributes aren't "about the language", then=
why are they defined<i> by the language</i>? And how do you explain P0840?=
</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0;ma=
rgin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"lt=
r"><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>...</div><=
div><br></div><div>You're thinking about it backwards. If people freque=
ntly keep writing code like that, then on some level, they want to write it=
that way. It's natural for them to. So you can either slap them in the=
face and make them stop, or you can just<i> make it legal</i> and make it =
do what they expect.</div><div><br></div><div>Yes, making it legal properly=
is infinitely harder than just slapping an attribute on it and calling it =
a day. But why should C++ keep taking the easy path to "fixing" i=
ts problems?</div></div></blockquote><div><br></div><div>I don't find t=
he possibility of adding lifetime extensions realistic.=C2=A0 I don't m=
ind it, but I really, really doubt it will ever be added. Is there any work=
on in that direction? Have ever been any work on that?</div></div></blockq=
uote><div><br></div><div><a onmousedown=3D"this.href=3D'http://www.goog=
le.com/url?q\x3dhttp%3A%2F%2Fwg21.link%2FP0066\x26sa\x3dD\x26sntz\x3d1\x26u=
sg\x3dAFQjCNESJlrJTTrXPaGVemQg-SPWTHIHzQ';return true;" onclick=3D"this=
..href=3D'http://www.google.com/url?q\x3dhttp%3A%2F%2Fwg21.link%2FP0066\=
x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNESJlrJTTrXPaGVemQg-SPWTHIHzQ';r=
eturn true;" href=3D"http://wg21.link/P0066" target=3D"_blank" rel=3D"nofol=
low">Yes there has</a>. But apparently, <a onmousedown=3D"this.href=3D'=
https://www.google.com/url?q\x3dhttps%3A%2F%2Fbotondballo.wordpress.com%2F2=
015%2F11%2F09%2Ftrip-report-c-standards-meeting-in-kona-october-2015%2F\x26=
sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0fDsHBDmgIXlDvga9RNUVFObifw';retu=
rn true;" onclick=3D"this.href=3D'https://www.google.com/url?q\x3dhttps=
%3A%2F%2Fbotondballo.wordpress.com%2F2015%2F11%2F09%2Ftrip-report-c-standar=
ds-meeting-in-kona-october-2015%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCN=
H0fDsHBDmgIXlDvga9RNUVFObifw';return true;" href=3D"https://botondballo=
..wordpress.com/2015/11/09/trip-report-c-standards-meeting-in-kona-october-2=
015/" target=3D"_blank" rel=3D"nofollow">EWG didn't consider the cost o=
f consistent use of such annotations to be worth the fixing of this problem=
</a>.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div>Not that it is without problems - we break our own rules addi=
ng that. Yea, const ref already breaks it, but still. Even semantically is =
not very accurate - a view is 'slave' to the viewed, should not con=
trol it.</div><div>Also, what will happen with heap allocated views? Will t=
hey fail to compile and be illegal?=C2=A0</div><div><br></div><div>But as I=
said, I will not fight against lifetime extensions, I just don't see t=
hem coming. Ever.</div></div></blockquote><blockquote class=3D"gmail_quote"=
style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(2=
04,204,204);border-left-width:1px;border-left-style:solid"></blockquote><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Where with said =
attribute we can <i>considerably</i> improve the quality of the user code, =
making the foot gun very loud.</div></div></blockquote><div>=C2=A0</div><di=
v>Except where it doesn't, of course:</div><div><br></div><div style=3D=
"border:1px solid rgb(187,187,187);word-wrap:break-word;background-color:rg=
b(250,250,250)"><code><div><span style=3D"color:#008">auto</span><span styl=
e=3D"color:#000"> ptr </span><span style=3D"color:#660">=3D</span><span sty=
le=3D"color:#000"> make_shared</span><span style=3D"color:#660"><</span>=
<span style=3D"color:#000">A_view</span><span style=3D"color:#660">>(</s=
pan><span style=3D"color:#000">A</span><span style=3D"color:#660">{});</spa=
n><span style=3D"color:#000"><br></span></div></code></div><br></div></bloc=
kquote><div><br></div><div>You are not fair in your example. I was very spe=
cific - the attr will be ignored for heap allocated views (which are not th=
at widely used, if at all). In any case an attribute can be ignored - it is=
just a hint - it is whole different story if its an language extension.</d=
iv><div><br></div><div>However, even for heap allocated views it will be <i=
>possible</i> to give a warning if view is used after A is destroyed, where=
it is practically impossible to extend the lifetime of A!</div><div>=C2=A0=
</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div di=
r=3D"ltr"><div>After a discussion about the "extend me" proposal =
idea, I investigated the issues with an annotation-based approach. I conclu=
ded that the only way to make it work would be to add the equivalent of a<i=
> third</i> reference type (whether you spell it with `&&&` or =
some keyword or attribute associated with a reference parameter, the effect=
is to have a thing which behaves much like a third kind of reference). Whi=
ch means you'd have to make forwarding references work with such a tool=
.... somehow.</div><div><br></div><div>Your attribute-based annotation falls=
into the same trap: once you leave the immediate scope of the code creatin=
g the prvalue, it stops being a prvalue. So unless the immediate scope know=
s that the parameter is going to be used like this, it can't be annotat=
ed properly.</div></div></blockquote><div><br></div><div>You have to give m=
e an example, I am not sure I understand the issue. </div><div><br></div><d=
iv>My logic is very, very simple - as long as we have automatic variables (=
aka predictable destruction) the compiler knows <i>everything</i> needed to=
track improper use, given our specification of improper use.</div><div>Tem=
poraries, prvalues these have semantic value to us, but in the end - it is =
the compiler just rearranging the calls the dtors. All is visible to him - =
he created it. </div><div><br></div><div>If we, in this predictable for the=
compiler world, want a variable marked so we are informed it is used befor=
e another variable from this same predictable world, I am pretty sure the c=
ompiler can do this for us.</div><div><br></div><div>The point is, not want=
<i>can't</i> be done (the cases which will not be possible), but what =
<i>can</i> be done. Covering the trivial cases alone is not only better the=
n nothing, but will actually amount to 95% of the cases needed to be covere=
d in the first place.</div><div><br></div><div>=C2=A0</div><blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><br></div><div>Ultimatel=
y, I've come to believe that the only reasonable solution is something =
like `extend_me`: something which explicitly extends the lifetime of a temp=
orary, which is the responsibility of the writer of the prvalue expression =
to properly use.</div><div><br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div dir=3D"ltr"><div>Actually I will not be surprised if implementations=
start doing that <span>by themselves</span> (warning in cases thy can veri=
fy). The question is, why the initiative should always come from them?</div=
></div></blockquote><div><br></div><div>Because the interaction between two=
rules of the standard makes this legal code behave in a way that is unexpe=
cted but clearly explicitly specified.</div></div></blockquote><div><br></d=
iv><div>Does not change the fact the standard not mandating warnings, it is=
the implementation which must take the initiative - warning for assignment=
in if statement, warning for no return, for fallthrough, for empty stateme=
nts, etc etc. These save lifes for pros and juniors alike.=C2=A0</div><div>=
<br></div><div>Ironically all the standard did is a way to turn these warni=
ngs off if they do not match the intend. However, how about the standard tu=
rning warnings on (in cases impl. agree are implementable). </div><div>Gran=
ted [[deprecated]] is such an example but, that is way too little, compared=
to what it is possible.</div><div><br></div><div><br></div><div>Sure it is=
better to make this code illegal, but what if it is not possible or too ha=
rd? As the saying (in my language) goes - [<b>It is] better [to have a]<spa=
n class=3D"gt-baf-word-clickable" style=3D"color: rgb(0, 0, 0); cursor: poi=
nter; height: auto; margin-bottom: 0px; margin-left: 4px; margin-right: 0px=
; margin-top: 1px; unicode-bidi: embed; vertical-align: top; white-space: n=
owrap;">sparrow in the hand, then an eagle in the sky.</span></b></div><div=
><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9ec7a895-af7b-43d3-b47a-b7c95ed8660b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9ec7a895-af7b-43d3-b47a-b7c95ed8660b=
%40isocpp.org</a>.<br />
------=_Part_3474_360892104.1516008446901--
------=_Part_3473_221638587.1516008446901--
.
Author: Richard Hodges <hodges.r@gmail.com>
Date: Mon, 15 Jan 2018 10:41:44 +0100
Raw View
--001a113fbfc61f37650562cd6cc4
Content-Type: text/plain; charset="UTF-8"
> The point is, not want *can't* be done (the cases which will not be
possible), but what *can* be done. Covering the trivial cases alone is not
only better then nothing, but will actually amount to 95% of the cases
needed to be covered in the first place.
Absolutely, unequivocally, this ^^
It is a travesty and a failure of the language specification that UB is
allowed into programs accidentally when it is perfectly possible to detect
it at compile time.
It makes a mockery of any claim of "compile-time safety" which we
constantly strive for with template constructs such as variant.
On 15 January 2018 at 10:27, <mihailnajdenov@gmail.com> wrote:
>
>
> On Monday, January 15, 2018 at 1:54:32 AM UTC+2, Nicol Bolas wrote:
>>
>>
>>
>> On Sunday, January 14, 2018 at 3:44:10 PM UTC-5, mihailn...@gmail.com
>> wrote:
>>>
>>>
>>>
>>> On Sunday, January 14, 2018 at 9:05:44 PM UTC+2, Nicol Bolas wrote:
>>>>
>>>> On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, mihailn...@gmail.com
>>>> wrote:
>>>>>
>>>>> On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:
>>>>>>
>>>>>> ...
>>>>>> ...
>>>>>>
>>>>>
>>>> And it's that "difference" that I'm saying shouldn't happen. If you
>>>> want a static analyzer to find bugs, that's great. But the standard should
>>>> not require it, nor should the standard be getting in the way of that
>>>> process.
>>>>
>>>
>>>> The standard should be about the actual language.
>>>>
>>>
>>> Yeah, but things like attributes are not about the language. And that is
>>> OK. If there is an attribute which will help you enforce correct code, why
>>> not have it?
>>>
>>
>> If attributes aren't "about the language", then why are they defined* by
>> the language*? And how do you explain P0840?
>>
>> ...
>>>>
>>>> You're thinking about it backwards. If people frequently keep writing
>>>> code like that, then on some level, they want to write it that way. It's
>>>> natural for them to. So you can either slap them in the face and make them
>>>> stop, or you can just* make it legal* and make it do what they expect.
>>>>
>>>> Yes, making it legal properly is infinitely harder than just slapping
>>>> an attribute on it and calling it a day. But why should C++ keep taking the
>>>> easy path to "fixing" its problems?
>>>>
>>>
>>> I don't find the possibility of adding lifetime extensions realistic. I
>>> don't mind it, but I really, really doubt it will ever be added. Is there
>>> any work on in that direction? Have ever been any work on that?
>>>
>>
>> Yes there has <http://wg21.link/P0066>. But apparently, EWG didn't
>> consider the cost of consistent use of such annotations to be worth the
>> fixing of this problem
>> <https://botondballo.wordpress.com/2015/11/09/trip-report-c-standards-meeting-in-kona-october-2015/>
>> .
>>
>> Not that it is without problems - we break our own rules adding that.
>>> Yea, const ref already breaks it, but still. Even semantically is not very
>>> accurate - a view is 'slave' to the viewed, should not control it.
>>> Also, what will happen with heap allocated views? Will they fail to
>>> compile and be illegal?
>>>
>>> But as I said, I will not fight against lifetime extensions, I just
>>> don't see them coming. Ever.
>>>
>> Where with said attribute we can *considerably* improve the quality of
>>> the user code, making the foot gun very loud.
>>>
>>
>> Except where it doesn't, of course:
>>
>> auto ptr = make_shared<A_view>(A{});
>>
>>
> You are not fair in your example. I was very specific - the attr will be
> ignored for heap allocated views (which are not that widely used, if at
> all). In any case an attribute can be ignored - it is just a hint - it is
> whole different story if its an language extension.
>
> However, even for heap allocated views it will be *possible* to give a
> warning if view is used after A is destroyed, where it is practically
> impossible to extend the lifetime of A!
>
>
>
>> After a discussion about the "extend me" proposal idea, I investigated
>> the issues with an annotation-based approach. I concluded that the only way
>> to make it work would be to add the equivalent of a* third* reference
>> type (whether you spell it with `&&&` or some keyword or attribute
>> associated with a reference parameter, the effect is to have a thing which
>> behaves much like a third kind of reference). Which means you'd have to
>> make forwarding references work with such a tool... somehow.
>>
>> Your attribute-based annotation falls into the same trap: once you leave
>> the immediate scope of the code creating the prvalue, it stops being a
>> prvalue. So unless the immediate scope knows that the parameter is going to
>> be used like this, it can't be annotated properly.
>>
>
> You have to give me an example, I am not sure I understand the issue.
>
> My logic is very, very simple - as long as we have automatic variables
> (aka predictable destruction) the compiler knows *everything* needed to
> track improper use, given our specification of improper use.
> Temporaries, prvalues these have semantic value to us, but in the end - it
> is the compiler just rearranging the calls the dtors. All is visible to him
> - he created it.
>
> If we, in this predictable for the compiler world, want a variable marked
> so we are informed it is used before another variable from this same
> predictable world, I am pretty sure the compiler can do this for us.
>
> The point is, not want *can't* be done (the cases which will not be
> possible), but what *can* be done. Covering the trivial cases alone is
> not only better then nothing, but will actually amount to 95% of the cases
> needed to be covered in the first place.
>
>
>
>>
>> Ultimately, I've come to believe that the only reasonable solution is
>> something like `extend_me`: something which explicitly extends the lifetime
>> of a temporary, which is the responsibility of the writer of the prvalue
>> expression to properly use.
>>
>> Actually I will not be surprised if implementations start doing that by
>>> themselves (warning in cases thy can verify). The question is, why the
>>> initiative should always come from them?
>>>
>>
>> Because the interaction between two rules of the standard makes this
>> legal code behave in a way that is unexpected but clearly explicitly
>> specified.
>>
>
> Does not change the fact the standard not mandating warnings, it is the
> implementation which must take the initiative - warning for assignment in
> if statement, warning for no return, for fallthrough, for empty statements,
> etc etc. These save lifes for pros and juniors alike.
>
> Ironically all the standard did is a way to turn these warnings off if
> they do not match the intend. However, how about the standard turning
> warnings on (in cases impl. agree are implementable).
> Granted [[deprecated]] is such an example but, that is way too little,
> compared to what it is possible.
>
>
> Sure it is better to make this code illegal, but what if it is not
> possible or too hard? As the saying (in my language) goes - [*It is]
> better [to have a]sparrow in the hand, then an eagle in the sky.*
>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/9ec7a895-af7b-43d3-
> b47a-b7c95ed8660b%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9ec7a895-af7b-43d3-b47a-b7c95ed8660b%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hZZjgkjaOsXFReLmtoYib5Nzmndw9dxbCsSw2ztvTEz5Q%40mail.gmail.com.
--001a113fbfc61f37650562cd6cc4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">>=C2=A0<span style=3D"font-size:12.8px">The point is, n=
ot want=C2=A0</span><i style=3D"font-size:12.8px">can't</i><span style=
=3D"font-size:12.8px">=C2=A0be done (the cases which will not be possible),=
but what=C2=A0</span><i style=3D"font-size:12.8px">can</i><span style=3D"f=
ont-size:12.8px">=C2=A0be done. Covering the trivial cases alone is not onl=
y better then nothing, but will actually amount to 95% of the cases needed =
to be covered in the first place.<br><br>Absolutely, unequivocally, this ^^=
</span><div><span style=3D"font-size:12.8px"><br></span></div><div><span st=
yle=3D"font-size:12.8px">It is a travesty and a failure of the language spe=
cification that UB is allowed into programs accidentally when it is perfect=
ly possible to detect it at compile time.</span></div><div><span style=3D"f=
ont-size:12.8px"><br></span></div><div><span style=3D"font-size:12.8px">It =
makes a mockery of any claim of "compile-time safety" which we co=
nstantly strive for with template constructs such as variant.</span></div><=
div><span style=3D"font-size:12.8px"><br></span></div><div><span style=3D"f=
ont-size:12.8px"><br></span></div><div><span style=3D"font-size:12.8px"><br=
></span></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quot=
e">On 15 January 2018 at 10:27, <span dir=3D"ltr"><<a href=3D"mailto:mi=
hailnajdenov@gmail.com" target=3D"_blank">mihailnajdenov@gmail.com</a>><=
/span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span clas=
s=3D""><br><br>On Monday, January 15, 2018 at 1:54:32 AM UTC+2, Nicol Bolas=
wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8e=
x;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br>On =
Sunday, January 14, 2018 at 3:44:10 PM UTC-5, <a>mihailn...@gmail.com</a> w=
rote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br>On Su=
nday, January 14, 2018 at 9:05:44 PM UTC+2, Nicol Bolas wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr">On Sunday, January 14, 2018 at =
11:34:42 AM UTC-5, <a>mihailn...@gmail.com</a> wrote:<blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr">On Sunday, January 14, 2018 at 6:03:45 P=
M UTC+2, Nicol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr">...<div></div><div>...</div></div></blockquote></div></blockquote>=
<div><br></div><div>And it's that "difference" that I'm s=
aying shouldn't happen. If you want a static analyzer to find bugs, tha=
t's great. But the standard should not require it, nor should the stand=
ard be getting in the way of that process.</div></div></blockquote><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br></div><div>The st=
andard should be about the actual language.</div></div></blockquote><div><b=
r></div><div>Yeah, but things like attributes are not about the language. A=
nd that is OK. If there is an attribute which will help you enforce correct=
code, why not have it?=C2=A0</div></div></blockquote><div><br></div><div>I=
f attributes aren't "about the language", then why are they d=
efined<i> by the language</i>? And how do you explain P0840?</div><div><br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex=
;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><blockquote =
class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #=
ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>...</div><div><br></div><=
div>You're thinking about it backwards. If people frequently keep writi=
ng code like that, then on some level, they want to write it that way. It&#=
39;s natural for them to. So you can either slap them in the face and make =
them stop, or you can just<i> make it legal</i> and make it do what they ex=
pect.</div><div><br></div><div>Yes, making it legal properly is infinitely =
harder than just slapping an attribute on it and calling it a day. But why =
should C++ keep taking the easy path to "fixing" its problems?</d=
iv></div></blockquote><div><br></div><div>I don't find the possibility =
of adding lifetime extensions realistic.=C2=A0 I don't mind it, but I r=
eally, really doubt it will ever be added. Is there any work on in that dir=
ection? Have ever been any work on that?</div></div></blockquote><div><br><=
/div><div><a href=3D"http://wg21.link/P0066" rel=3D"nofollow" target=3D"_bl=
ank">Yes there has</a>. But apparently, <a href=3D"https://botondballo.word=
press.com/2015/11/09/trip-report-c-standards-meeting-in-kona-october-2015/"=
rel=3D"nofollow" target=3D"_blank">EWG didn't consider the cost of con=
sistent use of such annotations to be worth the fixing of this problem</a>.=
</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0;ma=
rgin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"lt=
r"><div>Not that it is without problems - we break our own rules adding tha=
t. Yea, const ref already breaks it, but still. Even semantically is not ve=
ry accurate - a view is 'slave' to the viewed, should not control i=
t.</div><div>Also, what will happen with heap allocated views? Will they fa=
il to compile and be illegal?=C2=A0</div><div><br></div><div>But as I said,=
I will not fight against lifetime extensions, I just don't see them co=
ming. Ever.</div></div></blockquote><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204=
,204);border-left-width:1px;border-left-style:solid"></blockquote><blockquo=
te class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Where with said attrib=
ute we can <i>considerably</i> improve the quality of the user code, making=
the foot gun very loud.</div></div></blockquote><div>=C2=A0</div><div>Exce=
pt where it doesn't, of course:</div><div><br></div><div style=3D"borde=
r:1px solid rgb(187,187,187);word-wrap:break-word;background-color:rgb(250,=
250,250)"><code><div><span style=3D"color:#008">auto</span><span style=3D"c=
olor:#000"> ptr </span><span style=3D"color:#660">=3D</span><span style=3D"=
color:#000"> make_shared</span><span style=3D"color:#660"><</span><span =
style=3D"color:#000">A_view</span><span style=3D"color:#660">>(</span><s=
pan style=3D"color:#000">A</span><span style=3D"color:#660">{});</span><spa=
n style=3D"color:#000"><br></span></div></code></div><br></div></blockquote=
><div><br></div></span><div>You are not fair in your example. I was very sp=
ecific - the attr will be ignored for heap allocated views (which are not t=
hat widely used, if at all). In any case an attribute can be ignored - it i=
s just a hint - it is whole different story if its an language extension.</=
div><div><br></div><div>However, even for heap allocated views it will be <=
i>possible</i> to give a warning if view is used after A is destroyed, wher=
e it is practically impossible to extend the lifetime of A!</div><span clas=
s=3D""><div>=C2=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" =
style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr"><div>After a discussion about the "extend me&qu=
ot; proposal idea, I investigated the issues with an annotation-based appro=
ach. I concluded that the only way to make it work would be to add the equi=
valent of a<i> third</i> reference type (whether you spell it with `&&a=
mp;&` or some keyword or attribute associated with a reference paramete=
r, the effect is to have a thing which behaves much like a third kind of re=
ference). Which means you'd have to make forwarding references work wit=
h such a tool... somehow.</div><div><br></div><div>Your attribute-based ann=
otation falls into the same trap: once you leave the immediate scope of the=
code creating the prvalue, it stops being a prvalue. So unless the immedia=
te scope knows that the parameter is going to be used like this, it can'=
;t be annotated properly.</div></div></blockquote><div><br></div></span><di=
v>You have to give me an example, I am not sure I understand the issue. </d=
iv><div><br></div><div>My logic is very, very simple - as long as we have a=
utomatic variables (aka predictable destruction) the compiler knows <i>ever=
ything</i> needed to track improper use, given our specification of imprope=
r use.</div><div>Temporaries, prvalues these have semantic value to us, but=
in the end - it is the compiler just rearranging the calls the dtors. All =
is visible to him - he created it. </div><div><br></div><div>If we, in this=
predictable for the compiler world, want a variable marked so we are infor=
med it is used before another variable from this same predictable world, I =
am pretty sure the compiler can do this for us.</div><div><br></div><div>Th=
e point is, not want <i>can't</i> be done (the cases which will not be =
possible), but what <i>can</i> be done. Covering the trivial cases alone is=
not only better then nothing, but will actually amount to 95% of the cases=
needed to be covered in the first place.</div><span class=3D""><div><br></=
div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0;ma=
rgin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"lt=
r"><div><br></div><div>Ultimately, I've come to believe that the only r=
easonable solution is something like `extend_me`: something which explicitl=
y extends the lifetime of a temporary, which is the responsibility of the w=
riter of the prvalue expression to properly use.</div><div><br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left=
:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Actually I will not=
be surprised if implementations start doing that <span>by themselves</span=
> (warning in cases thy can verify). The question is, why the initiative sh=
ould always come from them?</div></div></blockquote><div><br></div><div>Bec=
ause the interaction between two rules of the standard makes this legal cod=
e behave in a way that is unexpected but clearly explicitly specified.</div=
></div></blockquote><div><br></div></span><div>Does not change the fact the=
standard not mandating warnings, it is the implementation which must take =
the initiative - warning for assignment in if statement, warning for no ret=
urn, for fallthrough, for empty statements, etc etc. These save lifes for p=
ros and juniors alike.=C2=A0</div><div><br></div><div>Ironically all the st=
andard did is a way to turn these warnings off if they do not match the int=
end. However, how about the standard turning warnings on (in cases impl. ag=
ree are implementable). </div><div>Granted [[deprecated]] is such an exampl=
e but, that is way too little, compared to what it is possible.</div><div><=
br></div><div><br></div><div>Sure it is better to make this code illegal, b=
ut what if it is not possible or too hard? As the saying (in my language) g=
oes - [<b>It is] better [to have a]<span class=3D"m_-4776176221821103660gt-=
baf-word-clickable" style=3D"color:rgb(0,0,0);height:auto;margin-bottom:0px=
;margin-left:4px;margin-right:0px;margin-top:1px;unicode-bidi:embed;vertica=
l-align:top;white-space:nowrap">sparrow in the hand, then an eagle in the s=
ky.</span></b></div><div><br></div></div><span class=3D"">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9ec7a895-af7b-43d3-b47a-b7c95ed8660b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/9ec7=
a895-af7b-43d3-<wbr>b47a-b7c95ed8660b%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALvx3hZZjgkjaOsXFReLmtoYib5Nzmndw9dx=
bCsSw2ztvTEz5Q%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hZZjgkjaOsX=
FReLmtoYib5Nzmndw9dxbCsSw2ztvTEz5Q%40mail.gmail.com</a>.<br />
--001a113fbfc61f37650562cd6cc4--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 15 Jan 2018 09:48:04 -0800 (PST)
Raw View
------=_Part_5610_1263075780.1516038484340
Content-Type: multipart/alternative;
boundary="----=_Part_5611_925091296.1516038484341"
------=_Part_5611_925091296.1516038484341
Content-Type: text/plain; charset="UTF-8"
On Monday, January 15, 2018 at 4:27:27 AM UTC-5, mihailn...@gmail.com wrote:
>
> On Monday, January 15, 2018 at 1:54:32 AM UTC+2, Nicol Bolas wrote:
>>
>> On Sunday, January 14, 2018 at 3:44:10 PM UTC-5, mihailn...@gmail.com
>> wrote:
>>>
>>> On Sunday, January 14, 2018 at 9:05:44 PM UTC+2, Nicol Bolas wrote:
>>>>
>>>> On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, mihailn...@gmail.com
>>>> wrote:
>>>>>
>>>>> On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote:
>>>>>>
>>>>>> ...
>>>>>> ...
>>>>>>
>>>>>
>>>> And it's that "difference" that I'm saying shouldn't happen. If you
>>>> want a static analyzer to find bugs, that's great. But the standard should
>>>> not require it, nor should the standard be getting in the way of that
>>>> process.
>>>>
>>>
>>>> The standard should be about the actual language.
>>>>
>>>
>>> Yeah, but things like attributes are not about the language. And that is
>>> OK. If there is an attribute which will help you enforce correct code, why
>>> not have it?
>>>
>>
>> If attributes aren't "about the language", then why are they defined* by
>> the language*? And how do you explain P0840?
>>
>> ...
>>>>
>>>> You're thinking about it backwards. If people frequently keep writing
>>>> code like that, then on some level, they want to write it that way. It's
>>>> natural for them to. So you can either slap them in the face and make them
>>>> stop, or you can just* make it legal* and make it do what they expect.
>>>>
>>>> Yes, making it legal properly is infinitely harder than just slapping
>>>> an attribute on it and calling it a day. But why should C++ keep taking the
>>>> easy path to "fixing" its problems?
>>>>
>>>
>>> I don't find the possibility of adding lifetime extensions realistic. I
>>> don't mind it, but I really, really doubt it will ever be added. Is there
>>> any work on in that direction? Have ever been any work on that?
>>>
>>
>> Yes there has <http://wg21.link/P0066>. But apparently, EWG didn't
>> consider the cost of consistent use of such annotations to be worth the
>> fixing of this problem
>> <https://botondballo.wordpress.com/2015/11/09/trip-report-c-standards-meeting-in-kona-october-2015/>
>> .
>>
>> Not that it is without problems - we break our own rules adding that.
>>> Yea, const ref already breaks it, but still. Even semantically is not very
>>> accurate - a view is 'slave' to the viewed, should not control it.
>>> Also, what will happen with heap allocated views? Will they fail to
>>> compile and be illegal?
>>>
>>> But as I said, I will not fight against lifetime extensions, I just
>>> don't see them coming. Ever.
>>>
>> Where with said attribute we can *considerably* improve the quality of
>>> the user code, making the foot gun very loud.
>>>
>>
>> Except where it doesn't, of course:
>>
>> auto ptr = make_shared<A_view>(A{});
>>
>>
> You are not fair in your example. I was very specific - the attr will be
> ignored for heap allocated views (which are not that widely used, if at
> all). In any case an attribute can be ignored - it is just a hint - it is
> whole different story if its an language extension.
>
The heap allocation is irrelevant; the problem is indirect initialization
of the object. Consider this:
template<typename T, typename ...Args>
auto initialize(Args ...&&args)
{
return T(std::forward<Args>(args)...);
}
auto var = initialize<A_view>(A{});
Or even simpler:
optional<A_view> ovar(in_place, A{});
*Any instance* where you initialize `A_view` via forwarding will not
properly detect that you're using a temporary, since the forwarding
function cannot tell the difference between an xvalue and a prvalue.
That's ultimately why I concluded that annotation-based solutions can't
work, that you have to create a "third reference" that preserves the
prvalue-ness of the argument. That is, if you want to correctly deal with
lifetime issues, you need to be able to tell the difference, not between
lvalues and rvalues, but between lvalues, xvalues, and prvalues.
And technically, you need a* sixth* value category too. One that represents
the difference between `prvalue.member`, which is not technically a prvalue
but can extend the temporary's lifetime, and a function call on a prvalue
that returns an xvalue subobject of the prvalue, which doesn't extend its
lifetime.
However, even for heap allocated views it will be *possible* to give a
> warning if view is used after A is destroyed, where it is practically
> impossible to extend the lifetime of A!
>
>
>
>> After a discussion about the "extend me" proposal idea, I investigated
>> the issues with an annotation-based approach. I concluded that the only way
>> to make it work would be to add the equivalent of a* third* reference
>> type (whether you spell it with `&&&` or some keyword or attribute
>> associated with a reference parameter, the effect is to have a thing which
>> behaves much like a third kind of reference). Which means you'd have to
>> make forwarding references work with such a tool... somehow.
>>
>> Your attribute-based annotation falls into the same trap: once you leave
>> the immediate scope of the code creating the prvalue, it stops being a
>> prvalue. So unless the immediate scope knows that the parameter is going to
>> be used like this, it can't be annotated properly.
>>
>
> You have to give me an example, I am not sure I understand the issue.
>
> My logic is very, very simple - as long as we have automatic variables
> (aka predictable destruction) the compiler knows *everything* needed to
> track improper use, given our specification of improper use.
>
See above. The compiler cannot just look at the prvalue argument and an
attribute on the parameter to tell what's going on. `A_view` is not being
fed a prvalue; it's being fed an xvalue. And by all rights, that ought to
be fine.
Temporaries, prvalues these have semantic value to us, but in the end - it
> is the compiler just rearranging the calls the dtors. All is visible to him
> - he created it.
>
> If we, in this predictable for the compiler world, want a variable marked
> so we are informed it is used before another variable from this same
> predictable world, I am pretty sure the compiler can do this for us.
>
> The point is, not want *can't* be done (the cases which will not be
> possible), but what *can* be done. Covering the trivial cases alone is
> not only better then nothing, but will actually amount to 95% of the cases
> needed to be covered in the first place.
>
No, half-measures are actually worse than doing nothing. Why?
Because right now, we can teach people "be careful with view types and
temporaries". We can teach people about lifetime issues and so forth. Maybe
not enough programmers get this lesson, but the information is still out
there.
But if you give people the illusion that the compiler can handle this
issue, that they'll get a compile error or whatever if they improperly use
views and temporaries, then people will use view types and temporaries with
abandon. They won't realize that the compiler can't catch* all* of these
kinds of problems. Without the training to avoid this problem, they're more
likely to run into it in indirect initialization cases and so forth,
because they have faith the compiler will tell them when they're doing it
wrong.
If you can't solve this problem, better to do nothing at all. At least
then, we'll always be on our toes. Better that than to become complacent.
Ultimately, I've come to believe that the only reasonable solution is
>> something like `extend_me`: something which explicitly extends the lifetime
>> of a temporary, which is the responsibility of the writer of the prvalue
>> expression to properly use.
>>
>> Actually I will not be surprised if implementations start doing that by
>>> themselves (warning in cases thy can verify). The question is, why the
>>> initiative should always come from them?
>>>
>>
>> Because the interaction between two rules of the standard makes this
>> legal code behave in a way that is unexpected but clearly explicitly
>> specified.
>>
>
> Does not change the fact the standard not mandating warnings, it is the
> implementation which must take the initiative - warning for assignment in
> if statement, warning for no return, for fallthrough, for empty statements,
> etc etc. These save lifes for pros and juniors alike.
>
Ironically all the standard did is a way to turn these warnings off if they
> do not match the intend. However, how about the standard turning warnings
> on (in cases impl. agree are implementable).
>
The standard defines behavior. Warnings are not behavior. Thus, it has no
right to mandate warnings.
> Granted [[deprecated]] is such an example but, that is way too little,
> compared to what it is possible.
>
>
> Sure it is better to make this code illegal, but what if it is not
> possible or too hard? As the saying (in my language) goes - [*It is]
> better [to have a]sparrow in the hand, then an eagle in the sky.*
>
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/dc689be1-8ab4-4c06-86d9-4d9d9cc313b4%40isocpp.org.
------=_Part_5611_925091296.1516038484341
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Monday, January 15, 2018 at 4:27:27 AM UTC-5, mihailn..=
..@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr">On Monday, January 15, 2018 at 1:54:32 AM UTC+2, Nicol Bolas wrote:<bl=
ockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Sunday, January 14=
, 2018 at 3:44:10 PM UTC-5, <a>mihailn...@gmail.com</a> wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr">On Sunday, January 14, 2018 at =
9:05:44 PM UTC+2, Nicol Bolas wrote:<blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div dir=3D"ltr">On Sunday, January 14, 2018 at 11:34:42 AM UTC-5, <a>miha=
iln...@gmail.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr">On Sunday, January 14, 2018 at 6:03:45 PM UTC+2, Nicol Bolas wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">...<div></div><di=
v>...</div></div></blockquote></div></blockquote><div><br></div><div>And it=
's that "difference" that I'm saying shouldn't happen=
.. If you want a static analyzer to find bugs, that's great. But the sta=
ndard should not require it, nor should the standard be getting in the way =
of that process.</div></div></blockquote><blockquote class=3D"gmail_quote" =
style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr"><div><br></div><div>The standard should be about the=
actual language.</div></div></blockquote><div><br></div><div>Yeah, but thi=
ngs like attributes are not about the language. And that is OK. If there is=
an attribute which will help you enforce correct code, why not have it?=C2=
=A0</div></div></blockquote><div><br></div><div>If attributes aren't &q=
uot;about the language", then why are they defined<i> by the language<=
/i>? And how do you explain P0840?</div><div><br></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc soli=
d;padding-left:1ex"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div dir=3D"ltr"><div>...</div><div><br></div><div>You're thinking ab=
out it backwards. If people frequently keep writing code like that, then on=
some level, they want to write it that way. It's natural for them to. =
So you can either slap them in the face and make them stop, or you can just=
<i> make it legal</i> and make it do what they expect.</div><div><br></div>=
<div>Yes, making it legal properly is infinitely harder than just slapping =
an attribute on it and calling it a day. But why should C++ keep taking the=
easy path to "fixing" its problems?</div></div></blockquote><div=
><br></div><div>I don't find the possibility of adding lifetime extensi=
ons realistic.=C2=A0 I don't mind it, but I really, really doubt it wil=
l ever be added. Is there any work on in that direction? Have ever been any=
work on that?</div></div></blockquote><div><br></div><div><a onmousedown=
=3D"this.href=3D'http://www.google.com/url?q\x3dhttp%3A%2F%2Fwg21.link%=
2FP0066\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNESJlrJTTrXPaGVemQg-SPWTHIHz=
Q';return true;" onclick=3D"this.href=3D'http://www.google.com/url?=
q\x3dhttp%3A%2F%2Fwg21.link%2FP0066\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjC=
NESJlrJTTrXPaGVemQg-SPWTHIHzQ';return true;" href=3D"http://wg21.link/P=
0066" target=3D"_blank" rel=3D"nofollow">Yes there has</a>. But apparently,=
<a onmousedown=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3=
A%2F%2Fbotondballo.wordpress.com%2F2015%2F11%2F09%2Ftrip-report-c-standards=
-meeting-in-kona-october-2015%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0=
fDsHBDmgIXlDvga9RNUVFObifw';return true;" onclick=3D"this.href=3D'h=
ttps://www.google.com/url?q\x3dhttps%3A%2F%2Fbotondballo.wordpress.com%2F20=
15%2F11%2F09%2Ftrip-report-c-standards-meeting-in-kona-october-2015%2F\x26s=
a\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0fDsHBDmgIXlDvga9RNUVFObifw';retur=
n true;" href=3D"https://botondballo.wordpress.com/2015/11/09/trip-report-c=
-standards-meeting-in-kona-october-2015/" target=3D"_blank" rel=3D"nofollow=
">EWG didn't consider the cost of consistent use of such annotations to=
be worth the fixing of this problem</a>.</div><div><br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><div>Not that it is without pro=
blems - we break our own rules adding that. Yea, const ref already breaks i=
t, but still. Even semantically is not very accurate - a view is 'slave=
' to the viewed, should not control it.</div><div>Also, what will happe=
n with heap allocated views? Will they fail to compile and be illegal?=C2=
=A0</div><div><br></div><div>But as I said, I will not fight against lifeti=
me extensions, I just don't see them coming. Ever.</div></div></blockqu=
ote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;pad=
ding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;bord=
er-left-style:solid"></blockquote><blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div dir=3D"ltr"><div>Where with said attribute we can <i>considerably</i>=
improve the quality of the user code, making the foot gun very loud.</div>=
</div></blockquote><div>=C2=A0</div><div>Except where it doesn't, of co=
urse:</div><div><br></div><div style=3D"border:1px solid rgb(187,187,187);w=
ord-wrap:break-word;background-color:rgb(250,250,250)"><code><div><span sty=
le=3D"color:#008">auto</span><span style=3D"color:#000"> ptr </span><span s=
tyle=3D"color:#660">=3D</span><span style=3D"color:#000"> make_shared</span=
><span style=3D"color:#660"><</span><span style=3D"color:#000">A_view</s=
pan><span style=3D"color:#660">>(</span><span style=3D"color:#000">A</sp=
an><span style=3D"color:#660">{});</span><span style=3D"color:#000"><br></s=
pan></div></code></div><br></div></blockquote><div><br></div><div>You are n=
ot fair in your example. I was very specific - the attr will be ignored for=
heap allocated views (which are not that widely used, if at all). In any c=
ase an attribute can be ignored - it is just a hint - it is whole different=
story if its an language extension.</div></div></blockquote><div><br></div=
><div>The heap allocation is irrelevant; the problem is indirect initializa=
tion of the object. Consider this:</div><div><br></div><div class=3D"pretty=
print" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word=
; background-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div c=
lass=3D"subprettyprint"><span class=3D"styled-by-prettify" style=3D"color: =
#008;">template</span><span class=3D"styled-by-prettify" style=3D"color: #6=
60;"><</span><span class=3D"styled-by-prettify" style=3D"color: #008;">t=
ypename</span><span class=3D"styled-by-prettify" style=3D"color: #000;"> T<=
/span><span class=3D"styled-by-prettify" style=3D"color: #660;">,</span><sp=
an class=3D"styled-by-prettify" style=3D"color: #000;"> </span><span class=
=3D"styled-by-prettify" style=3D"color: #008;">typename</span><span class=
=3D"styled-by-prettify" style=3D"color: #000;"> </span><span class=3D"style=
d-by-prettify" style=3D"color: #660;">...</span><span class=3D"styled-by-pr=
ettify" style=3D"color: #606;">Args</span><span class=3D"styled-by-prettify=
" style=3D"color: #660;">></span><span class=3D"styled-by-prettify" styl=
e=3D"color: #000;"><br></span><span class=3D"styled-by-prettify" style=3D"c=
olor: #008;">auto</span><span class=3D"styled-by-prettify" style=3D"color: =
#000;"> initialize</span><span class=3D"styled-by-prettify" style=3D"color:=
#660;">(</span><span class=3D"styled-by-prettify" style=3D"color: #606;">A=
rgs</span><span class=3D"styled-by-prettify" style=3D"color: #000;"> </span=
><span class=3D"styled-by-prettify" style=3D"color: #660;">...&&</s=
pan><span class=3D"styled-by-prettify" style=3D"color: #000;">args</span><s=
pan class=3D"styled-by-prettify" style=3D"color: #660;">)</span><span class=
=3D"styled-by-prettify" style=3D"color: #000;"><br></span><span class=3D"st=
yled-by-prettify" style=3D"color: #660;">{</span><span class=3D"styled-by-p=
rettify" style=3D"color: #000;"><br>=C2=A0 </span><span class=3D"styled-by-=
prettify" style=3D"color: #008;">return</span><span class=3D"styled-by-pret=
tify" style=3D"color: #000;"> T</span><span class=3D"styled-by-prettify" st=
yle=3D"color: #660;">(</span><span class=3D"styled-by-prettify" style=3D"co=
lor: #000;">std</span><span class=3D"styled-by-prettify" style=3D"color: #6=
60;">::</span><span class=3D"styled-by-prettify" style=3D"color: #000;">for=
ward</span><span class=3D"styled-by-prettify" style=3D"color: #660;"><</=
span><span class=3D"styled-by-prettify" style=3D"color: #606;">Args</span><=
span class=3D"styled-by-prettify" style=3D"color: #660;">>(</span><span =
class=3D"styled-by-prettify" style=3D"color: #000;">args</span><span class=
=3D"styled-by-prettify" style=3D"color: #660;">)...);</span><span class=3D"=
styled-by-prettify" style=3D"color: #000;"><br></span><span class=3D"styled=
-by-prettify" style=3D"color: #660;">}</span><span class=3D"styled-by-prett=
ify" style=3D"color: #000;"><br><br></span><span class=3D"styled-by-prettif=
y" style=3D"color: #008;">auto</span><span class=3D"styled-by-prettify" sty=
le=3D"color: #000;"> </span><span class=3D"styled-by-prettify" style=3D"col=
or: #008;">var</span><span class=3D"styled-by-prettify" style=3D"color: #00=
0;"> </span><span class=3D"styled-by-prettify" style=3D"color: #660;">=3D</=
span><span class=3D"styled-by-prettify" style=3D"color: #000;"> initialize<=
/span><span class=3D"styled-by-prettify" style=3D"color: #660;"><</span>=
<span class=3D"styled-by-prettify" style=3D"color: #000;">A_view</span><spa=
n class=3D"styled-by-prettify" style=3D"color: #660;">>(</span><span cla=
ss=3D"styled-by-prettify" style=3D"color: #000;">A</span><span class=3D"sty=
led-by-prettify" style=3D"color: #660;">{});</span></div></code></div><div>=
<br></div><div>Or even simpler:</div><div><br></div><div class=3D"prettypri=
nt" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; b=
ackground-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div clas=
s=3D"subprettyprint"><span class=3D"styled-by-prettify" style=3D"color: #00=
0;">optional</span><span class=3D"styled-by-prettify" style=3D"color: #660;=
"><</span><span class=3D"styled-by-prettify" style=3D"color: #000;">A_vi=
ew</span><span class=3D"styled-by-prettify" style=3D"color: #660;">></sp=
an><span class=3D"styled-by-prettify" style=3D"color: #000;"> ovar</span><s=
pan class=3D"styled-by-prettify" style=3D"color: #660;">(</span><span class=
=3D"styled-by-prettify" style=3D"color: #000;">in_place</span><span class=
=3D"styled-by-prettify" style=3D"color: #660;">,</span><span class=3D"style=
d-by-prettify" style=3D"color: #000;"> A</span><span class=3D"styled-by-pre=
ttify" style=3D"color: #660;">{});</span></div></code></div><div><br></div>=
<div><i>Any instance</i> where you initialize `A_view` via forwarding will =
not properly detect that you're using a temporary, since the forwarding=
function cannot tell the difference between an xvalue and a prvalue.</div>=
<div><br></div><div>That's ultimately why I concluded that annotation-b=
ased solutions can't work, that you have to create a "third refere=
nce" that preserves the prvalue-ness of the argument. That is, if you =
want to correctly deal with lifetime issues, you need to be able to tell th=
e difference, not between lvalues and rvalues, but between lvalues, xvalues=
, and prvalues.</div><div><br></div><div>And technically, you need a<i> six=
th</i> value category too. One that represents the difference between `prva=
lue.member`, which is not technically a prvalue but can extend the temporar=
y's lifetime, and a function call on a prvalue that returns an xvalue s=
ubobject of the prvalue, which doesn't extend its lifetime.</div><div><=
i><br></i></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r"><div>However, even for heap allocated views it will be <i>possible</i> t=
o give a warning if view is used after A is destroyed, where it is practica=
lly impossible to extend the lifetime of A!</div><div>=C2=A0</div><div>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Afte=
r a discussion about the "extend me" proposal idea, I investigate=
d the issues with an annotation-based approach. I concluded that the only w=
ay to make it work would be to add the equivalent of a<i> third</i> referen=
ce type (whether you spell it with `&&&` or some keyword or att=
ribute associated with a reference parameter, the effect is to have a thing=
which behaves much like a third kind of reference). Which means you'd =
have to make forwarding references work with such a tool... somehow.</div><=
div><br></div><div>Your attribute-based annotation falls into the same trap=
: once you leave the immediate scope of the code creating the prvalue, it s=
tops being a prvalue. So unless the immediate scope knows that the paramete=
r is going to be used like this, it can't be annotated properly.</div><=
/div></blockquote><div><br></div><div>You have to give me an example, I am =
not sure I understand the issue. </div><div><br></div><div>My logic is very=
, very simple - as long as we have automatic variables (aka predictable des=
truction) the compiler knows <i>everything</i> needed to track improper use=
, given our specification of improper use.</div></div></blockquote><div>=C2=
=A0</div><div>See above. The compiler cannot just look at the prvalue argum=
ent and an attribute on the parameter to tell what's going on. `A_view`=
is not being fed a prvalue; it's being fed an xvalue. And by all right=
s, that ought to be fine.</div><div><br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padd=
ing-left: 1ex;"><div dir=3D"ltr"><div>Temporaries, prvalues these have sema=
ntic value to us, but in the end - it is the compiler just rearranging the =
calls the dtors. All is visible to him - he created it. </div><div><br></di=
v><div>If we, in this predictable for the compiler world, want a variable m=
arked so we are informed it is used before another variable from this same =
predictable world, I am pretty sure the compiler can do this for us.</div><=
div><br></div></div><div><div dir=3D"ltr">The point is, not want <i>can'=
;t</i> be done (the cases which will not be possible), but what <i>can</i> =
be done. Covering the trivial cases alone is not only better then nothing, =
but will actually amount to 95% of the cases needed to be covered in the fi=
rst place.</div></div></blockquote><div><br></div><div><div style=3D"backgr=
ound-color: transparent; border-bottom-color: rgb(34, 34, 34); border-botto=
m-style: none; border-bottom-width: 0px; border-image-outset: 0; border-ima=
ge-repeat: stretch; border-image-slice: 100%; border-image-source: none; bo=
rder-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style:=
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-=
right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 3=
4); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); =
font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-s=
erif; font-size: 13px; font-style: normal; font-variant: normal; font-weigh=
t: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decora=
tion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;">No, half-measures are act=
ually worse than doing nothing. Why?</div><div style=3D"background-color: t=
ransparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none=
; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: st=
retch; border-image-slice: 100%; border-image-source: none; border-image-wi=
dth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border=
-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: =
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-to=
p-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: =
&quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-si=
ze: 13px; font-style: normal; font-variant: normal; font-weight: 400; lette=
r-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;=
margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; paddi=
ng-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; t=
ext-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whit=
e-space: normal; word-spacing: 0px;"><br></div><div style=3D"background-col=
or: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style:=
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repea=
t: stretch; border-image-slice: 100%; border-image-source: none; border-ima=
ge-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; b=
order-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-st=
yle: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bord=
er-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-fam=
ily: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; fo=
nt-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; =
letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right:=
0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; =
padding-right: 0px; padding-top: 0px; text-align: left; text-decoration: no=
ne; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px;=
white-space: normal; word-spacing: 0px;">Because right now, we can teach p=
eople "be careful with view types and temporaries". We can teach =
people about lifetime issues and so forth. Maybe not enough programmers get=
this lesson, but the information is still out there.</div><div style=3D"ba=
ckground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-b=
ottom-style: none; border-bottom-width: 0px; border-image-outset: 0; border=
-image-repeat: stretch; border-image-slice: 100%; border-image-source: none=
; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-st=
yle: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bor=
der-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 3=
4, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 3=
4); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sa=
ns-serif; font-size: 13px; font-style: normal; font-variant: normal; font-w=
eight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; m=
argin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding=
-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-de=
coration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke=
-width: 0px; white-space: normal; word-spacing: 0px;"><br></div><div style=
=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); font-family: &quot;Arial&quot;,&quot;Helvetica&qu=
ot;,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; =
font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; p=
adding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; t=
ext-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-=
stroke-width: 0px; white-space: normal; word-spacing: 0px;">But if you give=
people the illusion that the compiler can handle this issue, that they'=
;ll get a compile error or whatever if they improperly use views and tempor=
aries, then people will use view types and temporaries with abandon. They w=
on't realize that the compiler can't catch<i> all</i> of these kind=
s of problems. Without the training to avoid this problem, they're more=
likely to run into it in indirect initialization cases and so forth, becau=
se they have faith the compiler will tell them when they're doing it wr=
ong.</div><div style=3D"background-color: transparent; border-bottom-color:=
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bord=
er-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%;=
border-image-source: none; border-image-width: 1; border-left-color: rgb(3=
4, 34, 34); border-left-style: none; border-left-width: 0px; border-right-c=
olor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; b=
order-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width:=
0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&q=
uot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal; fo=
nt-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom=
: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; pa=
dding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;=
text-align: left; text-decoration: none; text-indent: 0px; text-transform:=
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0=
px;"><br></div><div style=3D"background-color: transparent; border-bottom-c=
olor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px;=
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: =
100%; border-image-source: none; border-image-width: 1; border-left-color: =
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-ri=
ght-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0=
px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-w=
idth: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&=
amp;quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: norma=
l; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: =
2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top:=
0px; text-align: left; text-decoration: none; text-indent: 0px; text-trans=
form: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spaci=
ng: 0px;">If you can't solve this problem, better to do nothing at all.=
At least then, we'll always be on our toes. Better that than to become=
complacent.</div></div><div><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;"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin=
:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div>Ultimately, I've come to believe that the only reasonable=
solution is something like `extend_me`: something which explicitly extends=
the lifetime of a temporary, which is the responsibility of the writer of =
the prvalue expression to properly use.</div><div><br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc=
solid;padding-left:1ex"><div dir=3D"ltr"><div>Actually I will not be surpr=
ised if implementations start doing that <span>by themselves</span> (warnin=
g in cases thy can verify). The question is, why the initiative should alwa=
ys come from them?</div></div></blockquote><div><br></div><div>Because the =
interaction between two rules of the standard makes this legal code behave =
in a way that is unexpected but clearly explicitly specified.</div></div></=
blockquote><div><br></div><div>Does not change the fact the standard not ma=
ndating warnings, it is the implementation which must take the initiative -=
warning for assignment in if statement, warning for no return, for fallthr=
ough, for empty statements, etc etc. These save lifes for pros and juniors =
alike.=C2=A0</div></div></blockquote><blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(2=
04, 204, 204); border-left-width: 1px; border-left-style: solid;">=C2=A0</b=
lockquote><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.=
8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-=
width: 1px; border-left-style: solid;"><i></i></blockquote><blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Ironically all the stand=
ard did is a way to turn these warnings off if they do not match the intend=
.. However, how about the standard turning warnings on (in cases impl. agree=
are implementable).</div></div></blockquote><div><br></div><div>The standa=
rd defines behavior. Warnings are not behavior. Thus, it has no right to ma=
ndate warnings.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left=
: 1ex;"><div dir=3D"ltr"><div>Granted [[deprecated]] is such an example but=
, that is way too little, compared to what it is possible.</div><div><br></=
div><div><br></div><div>Sure it is better to make this code illegal, but wh=
at if it is not possible or too hard? As the saying (in my language) goes -=
[<b>It is] better [to have a]<span style=3D"color:rgb(0,0,0);min-height:au=
to;margin-bottom:0px;margin-left:4px;margin-right:0px;margin-top:1px;vertic=
al-align:top;white-space:nowrap">sparrow in the hand, then an eagle in the =
sky.</span></b></div><div><br></div></div></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/dc689be1-8ab4-4c06-86d9-4d9d9cc313b4%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/dc689be1-8ab4-4c06-86d9-4d9d9cc313b4=
%40isocpp.org</a>.<br />
------=_Part_5611_925091296.1516038484341--
------=_Part_5610_1263075780.1516038484340--
.
Author: mihailnajdenov@gmail.com
Date: Mon, 15 Jan 2018 12:07:55 -0800 (PST)
Raw View
------=_Part_2822_1777080784.1516046875619
Content-Type: multipart/alternative;
boundary="----=_Part_2823_989935661.1516046875620"
------=_Part_2823_989935661.1516046875620
Content-Type: text/plain; charset="UTF-8"
On Monday, January 15, 2018 at 7:48:04 PM UTC+2, Nicol Bolas wrote:
>
> On Monday, January 15, 2018 at 4:27:27 AM UTC-5, mihailn...@gmail.com
> wrote:
>>
>> ...
>>
>> You are not fair in your example. I was very specific - the attr will be
>> ignored for heap allocated views (which are not that widely used, if at
>> all). In any case an attribute can be ignored - it is just a hint - it is
>> whole different story if its an language extension.
>>
>
> The heap allocation is irrelevant; the problem is indirect initialization
> of the object. Consider this:
>
> template<typename T, typename ...Args>
> auto initialize(Args ...&&args)
> {
> return T(std::forward<Args>(args)...);
> }
>
> auto var = initialize<A_view>(A{});
>
> Or even simpler:
>
> optional<A_view> ovar(in_place, A{});
>
> *Any instance* where you initialize `A_view` via forwarding will not
> properly detect that you're using a temporary, since the forwarding
> function cannot tell the difference between an xvalue and a prvalue.
>
> That's ultimately why I concluded that annotation-based solutions can't
> work, that you have to create a "third reference" that preserves the
> prvalue-ness of the argument. That is, if you want to correctly deal with
> lifetime issues, you need to be able to tell the difference, not between
> lvalues and rvalues, but between lvalues, xvalues, and prvalues.
>
> And technically, you need a* sixth* value category too. One that
> represents the difference between `prvalue.member`, which is not
> technically a prvalue but can extend the temporary's lifetime, and a
> function call on a prvalue that returns an xvalue subobject of the prvalue,
> which doesn't extend its lifetime.
>
> However, even for heap allocated views it will be *possible* to give a
>> warning if view is used after A is destroyed, where it is practically
>> impossible to extend the lifetime of A!
>> ...
>> You have to give me an example, I am not sure I understand the issue.
>>
>> My logic is very, very simple - as long as we have automatic variables
>> (aka predictable destruction) the compiler knows *everything* needed to
>> track improper use, given our specification of improper use.
>>
>
> See above. The compiler cannot just look at the prvalue argument and an
> attribute on the parameter to tell what's going on. `A_view` is not being
> fed a prvalue; it's being fed an xvalue. And by all rights, that ought to
> be fine.
>
Oh, I see. However, does it matter? Consider:
A a;
A_view ref(std::move(a));
Sure, 'a' is not a temporary, but the same rules apply and still the
compiler has all the information it needs.
In the extend case the x/prvalue might have been important, but now they
are not.
The only thing that is important is to have visibility over the dtors, to
mark the correct variable, and iff ~A is called first, the compiler will
check for uses of ref b/w the calls of the two dtors.
>
> Temporaries, prvalues these have semantic value to us, but in the end - it
>> is the compiler just rearranging the calls the dtors. All is visible to him
>> - he created it.
>>
>> If we, in this predictable for the compiler world, want a variable marked
>> so we are informed it is used before another variable from this same
>> predictable world, I am pretty sure the compiler can do this for us.
>>
>> The point is, not want *can't* be done (the cases which will not be
>> possible), but what *can* be done. Covering the trivial cases alone is
>> not only better then nothing, but will actually amount to 95% of the cases
>> needed to be covered in the first place.
>>
>
> No, half-measures are actually worse than doing nothing. Why?
>
> Because right now, we can teach people "be careful with view types and
> temporaries". We can teach people about lifetime issues and so forth. Maybe
> not enough programmers get this lesson, but the information is still out
> there.
>
> But if you give people the illusion that the compiler can handle this
> issue, that they'll get a compile error or whatever if they improperly use
> views and temporaries, then people will use view types and temporaries with
> abandon. They won't realize that the compiler can't catch* all* of these
> kinds of problems. Without the training to avoid this problem, they're more
> likely to run into it in indirect initialization cases and so forth,
> because they have faith the compiler will tell them when they're doing it
> wrong.
>
> If you can't solve this problem, better to do nothing at all. At least
> then, we'll always be on our toes. Better that than to become complacent.
>
If you can't put a fence - you put a sigh.
If you can't solve the problem you give a warning (as much as you can).
And also, warnings teach better then UB!
We can teach exactly as before, the same lessons, however we put *some*
safety nets - *for all of us. *Everyone makes mistakes - I forget return
statements at least few times a year.
>
> Ultimately, I've come to believe that the only reasonable solution is
>>> something like `extend_me`: something which explicitly extends the lifetime
>>> of a temporary, which is the responsibility of the writer of the prvalue
>>> expression to properly use.
>>>
>>> Actually I will not be surprised if implementations start doing that by
>>>> themselves (warning in cases thy can verify). The question is, why the
>>>> initiative should always come from them?
>>>>
>>>
>>> Because the interaction between two rules of the standard makes this
>>> legal code behave in a way that is unexpected but clearly explicitly
>>> specified.
>>>
>>
>> Does not change the fact the standard not mandating warnings, it is the
>> implementation which must take the initiative - warning for assignment in
>> if statement, warning for no return, for fallthrough, for empty statements,
>> etc etc. These save lifes for pros and juniors alike.
>>
>
>
> Ironically all the standard did is a way to turn these warnings off if
>> they do not match the intend. However, how about the standard turning
>> warnings on (in cases impl. agree are implementable).
>>
>
> The standard defines behavior. Warnings are not behavior. Thus, it has no
> right to mandate warnings.
>
I don't know. If there is behavior, then there is incorrect behavior
(though legal code). I don't see harm of mandating warnings on incorrect
behavior, if possible and if it is not possible for the problem to be
solved (make the incorrect illegal).
But we are treading off topic here, as I didn't suggest a wildcard solution.
>
>
>> Granted [[deprecated]] is such an example but, that is way too little,
>> compared to what it is possible.
>>
>>
>> Sure it is better to make this code illegal, but what if it is not
>> possible or too hard? As the saying (in my language) goes - [*It is]
>> better [to have a]sparrow in the hand, then an eagle in the sky.*
>>
>>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c0383e6d-1422-403a-b1a7-43769f6be4f7%40isocpp.org.
------=_Part_2823_989935661.1516046875620
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Monday, January 15, 2018 at 7:48:04 PM UTC+2, N=
icol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr">On Monday, January 15, 2018 at 4:27:27 AM UTC-5, <a>mihailn...@gmail.co=
m</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left=
:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">...<di=
v><br></div><div>You are not fair in your example. I was very specific - th=
e attr will be ignored for heap allocated views (which are not that widely =
used, if at all). In any case an attribute can be ignored - it is just a hi=
nt - it is whole different story if its an language extension.</div></div><=
/blockquote><div><br></div><div>The heap allocation is irrelevant; the prob=
lem is indirect initialization of the object. Consider this:</div><div><br>=
</div><div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;=
background-color:rgb(250,250,250)"><code><div><span style=3D"color:#008">te=
mplate</span><span style=3D"color:#660"><</span><span style=3D"color:#00=
8">typename</span><span style=3D"color:#000"> T</span><span style=3D"color:=
#660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#008"=
>typename</span><span style=3D"color:#000"> </span><span style=3D"color:#66=
0">...</span><span style=3D"color:#606">Args</span><span style=3D"color:#66=
0">></span><span style=3D"color:#000"><br></span><span style=3D"color:#0=
08">auto</span><span style=3D"color:#000"> initialize</span><span style=3D"=
color:#660">(</span><span style=3D"color:#606">Args</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#660">...&&</span><span styl=
e=3D"color:#000">args</span><span style=3D"color:#660">)</span><span style=
=3D"color:#000"><br></span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"><br>=C2=A0 </span><span style=3D"color:#008">return</span><=
span style=3D"color:#000"> T</span><span style=3D"color:#660">(</span><span=
style=3D"color:#000">std</span><span style=3D"color:#660">::</span><span s=
tyle=3D"color:#000">forward</span><span style=3D"color:#660"><</span><sp=
an style=3D"color:#606">Args</span><span style=3D"color:#660">>(</span><=
span style=3D"color:#000">args</span><span style=3D"color:#660">)...)<wbr>;=
</span><span style=3D"color:#000"><br></span><span style=3D"color:#660">}</=
span><span style=3D"color:#000"><br><br></span><span style=3D"color:#008">a=
uto</span><span style=3D"color:#000"> </span><span style=3D"color:#008">var=
</span><span style=3D"color:#000"> </span><span style=3D"color:#660">=3D</s=
pan><span style=3D"color:#000"> initialize</span><span style=3D"color:#660"=
><</span><span style=3D"color:#000">A_view</span><span style=3D"color:#6=
60">>(</span><span style=3D"color:#000">A</span><span style=3D"color:#66=
0">{});</span></div></code></div><div><br></div><div>Or even simpler:</div>=
<div><br></div><div style=3D"border:1px solid rgb(187,187,187);word-wrap:br=
eak-word;background-color:rgb(250,250,250)"><code><div><span style=3D"color=
:#000">optional</span><span style=3D"color:#660"><</span><span style=3D"=
color:#000">A_view</span><span style=3D"color:#660">></span><span style=
=3D"color:#000"> ovar</span><span style=3D"color:#660">(</span><span style=
=3D"color:#000">in_place</span><span style=3D"color:#660">,</span><span sty=
le=3D"color:#000"> A</span><span style=3D"color:#660">{});</span></div></co=
de></div><div><br></div><div><i>Any instance</i> where you initialize `A_vi=
ew` via forwarding will not properly detect that you're using a tempora=
ry, since the forwarding function cannot tell the difference between an xva=
lue and a prvalue.</div><div><br></div><div>That's ultimately why I con=
cluded that annotation-based solutions can't work, that you have to cre=
ate a "third reference" that preserves the prvalue-ness of the ar=
gument. That is, if you want to correctly deal with lifetime issues, you ne=
ed to be able to tell the difference, not between lvalues and rvalues, but =
between lvalues, xvalues, and prvalues.</div><div><br></div><div>And techni=
cally, you need a<i> sixth</i> value category too. One that represents the =
difference between `prvalue.member`, which is not technically a prvalue but=
can extend the temporary's lifetime, and a function call on a prvalue =
that returns an xvalue subobject of the prvalue, which doesn't extend i=
ts lifetime.</div><div><i><br></i></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr"><div>However, even for heap allocated views it will b=
e <i>possible</i> to give a warning if view is used after A is destroyed, w=
here it is practically impossible to extend the lifetime of A!</div><div>=
=C2=A0...<br></div><div>You have to give me an example, I am not sure I und=
erstand the issue. </div><div><br></div><div>My logic is very, very simple =
- as long as we have automatic variables (aka predictable destruction) the =
compiler knows <i>everything</i> needed to track improper use, given our sp=
ecification of improper use.</div></div></blockquote><div>=C2=A0</div><div>=
See above. The compiler cannot just look at the prvalue argument and an att=
ribute on the parameter to tell what's going on. `A_view` is not being =
fed a prvalue; it's being fed an xvalue. And by all rights, that ought =
to be fine.</div></div></blockquote><div><br></div><div>Oh, I see. However,=
does it matter? Consider:</div><div><font face=3D"courier new,monospace"><=
br></font></div><div><font face=3D"courier new,monospace">A a;</font></div>=
<div><font face=3D"courier new,monospace">A_view ref(std::move(a));</font><=
/div><div><font face=3D"courier new,monospace"><br></font></div><div>Sure, =
'a' is not a temporary, but the same rules apply and still the comp=
iler has all the information it needs.</div><div><br></div><div>In the exte=
nd case the x/prvalue might have been important, but now they are not. </di=
v><div>The only thing that is important is to have visibility over the dtor=
s, to mark the correct variable, and=C2=A0<span style=3D"display: inline !i=
mportant; float: none; background-color: transparent; color: rgb(34, 34, 34=
); font-family: "Arial","Helvetica",sans-serif; font-si=
ze: 13px; font-style: normal; font-variant: normal; font-weight: 400; lette=
r-spacing: normal; orphans: 2; text-align: left; text-decoration: none; tex=
t-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-=
space: normal; word-spacing: 0px;">iff ~A is called first,</span> the compi=
ler will check for uses of <font face=3D"courier new,monospace">ref</font> =
b/w the calls of the two dtors.=C2=A0</div><div><br></div><div>=C2=A0</div>=
<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"ltr"><div><br></di=
v><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"ltr"><div>Temporaries=
, prvalues these have semantic value to us, but in the end - it is the comp=
iler just rearranging the calls the dtors. All is visible to him - he creat=
ed it. </div><div><br></div><div>If we, in this predictable for the compile=
r world, want a variable marked so we are informed it is used before anothe=
r variable from this same predictable world, I am pretty sure the compiler =
can do this for us.</div><div><br></div></div><div><div dir=3D"ltr">The poi=
nt is, not want <i>can't</i> be done (the cases which will not be possi=
ble), but what <i>can</i> be done. Covering the trivial cases alone is not =
only better then nothing, but will actually amount to 95% of the cases need=
ed to be covered in the first place.</div></div></blockquote><div><br></div=
><div><div>No, half-measures are actually worse than doing nothing. Why?</d=
iv><div><br></div><div>Because right now, we can teach people "be care=
ful with view types and temporaries". We can teach people about lifeti=
me issues and so forth. Maybe not enough programmers get this lesson, but t=
he information is still out there.</div><div><br></div><div>But if you give=
people the illusion that the compiler can handle this issue, that they'=
;ll get a compile error or whatever if they improperly use views and tempor=
aries, then people will use view types and temporaries with abandon. They w=
on't realize that the compiler can't catch<i> all</i> of these kind=
s of problems. Without the training to avoid this problem, they're more=
likely to run into it in indirect initialization cases and so forth, becau=
se they have faith the compiler will tell them when they're doing it wr=
ong.</div><div><br></div><div>If you can't solve this problem, better t=
o do nothing at all. At least then, we'll always be on our toes. Better=
that than to become complacent.</div></div></div></blockquote><div><br></d=
iv><div><span style=3D"display: inline !important; float: none; background-=
color: transparent; color: rgb(34, 34, 34); font-family: "Arial",=
"Helvetica",sans-serif; font-size: 13px; font-style: normal; font=
-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; tex=
t-align: left; text-decoration: none; text-indent: 0px; text-transform: non=
e; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"=
> </span><span style=3D"background-color: transparent; border-bottom-color:=
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bord=
er-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%;=
border-image-source: none; border-image-width: 1; border-left-color: rgb(3=
4, 34, 34); border-left-style: none; border-left-width: 0px; border-right-c=
olor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; b=
order-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width:=
0px; color: rgb(34, 34, 34); display: inline; float: none; font-family: &a=
mp;quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size=
: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-=
spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; m=
argin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding=
-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; tex=
t-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-=
space: normal; word-spacing: 0px;"><br></span></div><div><span style=3D"bac=
kground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bo=
ttom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-=
image-repeat: stretch; border-image-slice: 100%; border-image-source: none;=
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-sty=
le: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bord=
er-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34=
, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34=
); display: inline; float: none; font-family: &quot;Arial&quot;,&am=
p;quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal;=
font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bot=
tom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2;=
padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0=
px; text-align: left; text-decoration: none; text-indent: 0px; text-transfo=
rm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing=
: 0px;">If you can't put a fence - you put a sigh.</span></div><div>If =
you can't solve the problem you give a warning (as much as you can).</d=
iv><div style=3D"background-color: transparent; border-bottom-color: rgb(34=
, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-imag=
e-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border=
-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, =
34); border-left-style: none; border-left-width: 0px; border-right-color: r=
gb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-t=
op-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; c=
olor: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Hel=
vetica&quot;,sans-serif; font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; =
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-a=
lign: left; text-decoration: none; text-indent: 0px; text-transform: none; =
-webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><b=
r></div><div>And also, warnings teach better then UB!<b></b></div><div>We c=
an teach exactly as before, the same lessons, however we put <i>some</i> sa=
fety nets - <i>for all of us. </i>Everyone makes mistakes - I forget return=
statements at least few times a year.</div><div><i><br></i></div><div>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div=
><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:=
0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><blockq=
uote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:=
1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Ultimately, I've=
come to believe that the only reasonable solution is something like `exten=
d_me`: something which explicitly extends the lifetime of a temporary, whic=
h is the responsibility of the writer of the prvalue expression to properly=
use.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div>Actually I will not be surprised if implementations start doi=
ng that <span>by themselves</span> (warning in cases thy can verify). The q=
uestion is, why the initiative should always come from them?</div></div></b=
lockquote><div><br></div><div>Because the interaction between two rules of =
the standard makes this legal code behave in a way that is unexpected but c=
learly explicitly specified.</div></div></blockquote><div><br></div><div>Do=
es not change the fact the standard not mandating warnings, it is the imple=
mentation which must take the initiative - warning for assignment in if sta=
tement, warning for no return, for fallthrough, for empty statements, etc e=
tc. These save lifes for pros and juniors alike.=C2=A0</div></div></blockqu=
ote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;pad=
ding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;bord=
er-left-style:solid">=C2=A0</blockquote><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204=
,204,204);border-left-width:1px;border-left-style:solid"><i></i></blockquot=
e><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"ltr"><div>Ironically =
all the standard did is a way to turn these warnings off if they do not mat=
ch the intend. However, how about the standard turning warnings on (in case=
s impl. agree are implementable).</div></div></blockquote><div><br></div><d=
iv>The standard defines behavior. Warnings are not behavior. Thus, it has n=
o right to mandate warnings.</div></div></blockquote><div><br></div><div>I =
don't know. If there is behavior, then there is incorrect behavior (tho=
ugh legal code). I don't see harm of mandating warnings on incorrect be=
havior, if possible and if it is not possible for the problem to be solved =
(make the incorrect illegal).</div><div>But we are treading off topic here,=
as I didn't suggest a wildcard solution.</div><div>=C2=A0 =C2=A0</div>=
<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"ltr"><div>=C2=A0</=
div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Granted [=
[deprecated]] is such an example but, that is way too little, compared to w=
hat it is possible.</div><div><br></div><div><br></div><div>Sure it is bett=
er to make this code illegal, but what if it is not possible or too hard? A=
s the saying (in my language) goes - [<b>It is] better [to have a]<span sty=
le=3D"color:rgb(0,0,0);min-height:auto;margin-bottom:0px;margin-left:4px;ma=
rgin-right:0px;margin-top:1px;vertical-align:top;white-space:nowrap">sparro=
w in the hand, then an eagle in the sky.</span></b></div><div><br></div></d=
iv></blockquote></div></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/c0383e6d-1422-403a-b1a7-43769f6be4f7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c0383e6d-1422-403a-b1a7-43769f6be4f7=
%40isocpp.org</a>.<br />
------=_Part_2823_989935661.1516046875620--
------=_Part_2822_1777080784.1516046875619--
.
Author: "'Matt Calabrese' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Tue, 16 Jan 2018 11:19:40 -0500
Raw View
--001a113c81dc14d7c90562e71930
Content-Type: text/plain; charset="UTF-8"
On Sun, Jan 14, 2018 at 10:39 AM, j c <james.a.cooper@gmail.com> wrote:
> This discussion will be pointless until C++ decides what it should do when
> built-in static analysers discover undefined behaviour.
> Right now they use it as an excuse to generate heavily optimised, but
> ultimately incorrect, programs instead of just bailing out of the compile.
>
1) Any program with UB is broken. Optimizations are not what make them
broken.
2) Plenty of compilers do diagnose forms of UB at compile-time in places
where it is feasible to deduce or to reasonably assume that the code is
intended to be reachable when in a problematic state (simple example that
is often diagnosed in warnings is the lack of return statement for
functions, though even that is necessarily noisy). Sure, implementations
can always do more, but it's not as though developers are saying "here's UB
that we can detect at compile-time and that we will intentionally avoid
warning about, you know, just to annoy our users". That's a horrible
misconception that people need to stop perpetuating.
3) Just because an optimization seemingly takes advantage of UB does not
imply that potential execution leading to UB was detected or is even
feasibly detectable at compile-time with the language as-is (assumptions
that there are no data races, etc.).
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CANh8DE%3D5-n7RiK2mjbze%3DcoCHXcT50Fj_bQWe7tA1fFt7gx1Mw%40mail.gmail.com.
--001a113c81dc14d7c90562e71930
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On S=
un, Jan 14, 2018 at 10:39 AM, j c <span dir=3D"ltr"><<a href=3D"mailto:j=
ames.a.cooper@gmail.com" target=3D"_blank">james.a.cooper@gmail.com</a>>=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex">This discussion will be po=
intless until C++ decides what it should do when built-in static analysers =
discover undefined behaviour.<div>Right now they use it as an excuse to gen=
erate heavily optimised, but ultimately incorrect, programs instead of just=
bailing out of the compile.</div></blockquote><div><br></div><div>1) Any p=
rogram with UB is broken. Optimizations are not what make them broken.</div=
><div>2) Plenty of compilers do diagnose forms of UB at compile-time in pla=
ces where it is feasible to deduce or to reasonably assume that the code is=
intended to be reachable when in a problematic state (simple example that =
is often diagnosed in warnings is the lack of return statement for function=
s, though even that is necessarily noisy). Sure, implementations can always=
do more, but it's not as though developers are saying "here's=
UB that we can detect at compile-time and that we will intentionally avoid=
warning about, you know, just to annoy our users". That's a horri=
ble misconception that people need to stop perpetuating.</div><div>3) Just =
because an optimization seemingly takes advantage of UB does not imply that=
potential execution leading to UB was detected or is even feasibly detecta=
ble at compile-time with the language as-is (assumptions that there are no =
data races, etc.).</div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CANh8DE%3D5-n7RiK2mjbze%3DcoCHXcT50Fj=
_bQWe7tA1fFt7gx1Mw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CANh8DE%3D5-n=
7RiK2mjbze%3DcoCHXcT50Fj_bQWe7tA1fFt7gx1Mw%40mail.gmail.com</a>.<br />
--001a113c81dc14d7c90562e71930--
.
Author: =?UTF-8?Q?=27Thomas_K=C3=B6ppe=27_via_ISO_C=2B=2B_Standard_=2D_Future_Proposals?= <std-proposals@isocpp.org>
Date: Thu, 18 Jan 2018 03:21:56 -0800 (PST)
Raw View
------=_Part_2552_643768264.1516274516219
Content-Type: multipart/alternative;
boundary="----=_Part_2553_333868100.1516274516219"
------=_Part_2553_333868100.1516274516219
Content-Type: text/plain; charset="UTF-8"
On a tangential note, the committee has formed a new study group, SG 15, on
"Tooling", chaired by Titus Winters. The group is very new and hasn't yet
produced any public papers or other kinds of output, but I expect that
static analysis and automatic migration will be things in SG 15's scope.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/2722d36b-ab91-4d9b-8300-4fc4769ccecf%40isocpp.org.
------=_Part_2553_333868100.1516274516219
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On a tangential note, the committee has formed a new study=
group, SG 15, on "Tooling", chaired by Titus Winters. The group =
is very new and hasn't yet produced any public papers or other kinds of=
output, but I expect that static analysis and automatic migration will be =
things in SG 15's scope.</div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/2722d36b-ab91-4d9b-8300-4fc4769ccecf%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2722d36b-ab91-4d9b-8300-4fc4769ccecf=
%40isocpp.org</a>.<br />
------=_Part_2553_333868100.1516274516219--
------=_Part_2552_643768264.1516274516219--
.
Author: mihailnajdenov@gmail.com
Date: Thu, 18 Jan 2018 04:31:52 -0800 (PST)
Raw View
------=_Part_2492_1402644001.1516278712798
Content-Type: multipart/alternative;
boundary="----=_Part_2493_1779585719.1516278712802"
------=_Part_2493_1779585719.1516278712802
Content-Type: text/plain; charset="UTF-8"
For the sake of completeness, in cases when the viewed class creates the
view, then the && overload should be marked as [[dependent_lifetime]]
class string
{
...
[[dependent_lifetime]] operator string_view() && { return {c_str(),
size()}; } //< (probably not the correct place to set the attribute, but
you get the idea)
};
Now the returned value (the variable created from it) depends on the
lifetime of *this and should not be used after *this is dtor is called.
*Further investigation *
Consider that case:
void f()
{
string_view v;
if(const auto str = getString(); str == "something")
{
v = str;
}
* // 'v' is either empty or dangles!*
}
The above mistake can happen even to an experienced programmer (if he is
used to ref-counted strings for instance). People learning C++ and junior
developers are basically guaranteed to fall in there at some point.
Here it is *painfully* obvious the compiler knows the right usage - he just
keeps it shut! We *should* be able to make him speak.
BTW, that is an interesting case, as it is not about initialization, but
assignment. However, does it matter? It is still clear the scope of
tracking - from assignment tor dtor.
Even if we have a more involved case
void f( string_view& v)
{
if(const auto str = getString(); str == "something")
{
v = str;
}
}
int main()
{
string_view& v;
f(v);
return 0;
}
The compiler still knows all that is needed, doesn't it? As long as the
view is an automatic variable the compiler can always detected if, during
its lifetime, it is used after the pointed-to dtor is called.
Isn't that *always* the case? Isn't that that case *even if* the pointed-to
is heap allocated?
o_view v = o_p->getView();
The compiler can *still* tell if *o_p is destroyed before v is destroyed.
Am I mistaken here?
Considering view classes are 99.9% of the time used as automatic variables,
there is no good reason for them to be unsafe.
(Or maybe there is, I might be missing something)
And lets talk copies.
Nothing is actually preventing this tracking to work for copies of the view
as well - the rules are exactly the same - if before view.~view() there is
a call to object.~object() there should be no view,access().
How many views are, it does not matter at all as long as they are
automatic.
It also does not matter if ~object() was called by the compiler
(automatic), the user (delete p_object;) or by a ref counted shared_ptr!
With that in mind.
void f(view<B> vb) //< by copy
{
destroy_b_unknowingly();
vb.use(); //< warning, dtor of b was called already
}
Even further investigation
template<class T>
class unique_ptr
{
...
[[dependent_lifetime]] T* get() { return _p; }
...
T* _p;
};
Now the variable of type T* is a view to the unique_ptr. If ~unique_ptr()
is called before the (automatic) T* variable, created/assigned by get, goes
out of scope, it will be an error to use that variable.
But, lets take this to the next level:
template<class T>
class unique_ptr
{
...
[[dependent_lifetime(*_p)]] T* get() { return _p; }
...
T* _p;
};
Now it is an error to use T* after ~T(), and ~T(), can come from any place
- shared_ptr, manual delete, another, moved into unique_ptr. Everywhere.
And the rules are still the same - no use of this T* variable, after a
~T(), until this T* variable goes out of scope ("as if" it has a dtor
called).
The relationship is still b/w an automatic variable and a dtor call.
Am I fooling myself here? Isn't that mighty useful? Isn't that all
implementable today? What is the harm - it does not even writes off
lifetime extension and what not - it just reinforces safe use of the
language, the way this language is right now.
No new semantics, no new rules! (Arguably, no new tooling)
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/3a7fada1-f9f5-45d0-892f-74ccdf8eac2a%40isocpp.org.
------=_Part_2493_1779585719.1516278712802
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div style=3D"background-color: transparent; border-b=
ottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-widt=
h: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-=
slice: 100%; border-image-source: none; border-image-width: 1; border-left-=
color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; bo=
rder-right-color: rgb(34, 34, 34); border-right-style: none; border-right-w=
idth: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; borde=
r-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&=
quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style=
: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; m=
argin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; or=
phans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; paddi=
ng-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; tex=
t-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; wor=
d-spacing: 0px;">For the sake of completeness, in cases when the viewed cla=
ss creates the view, then the && overload should be marked as [[dep=
endent_lifetime]]=C2=A0</div><div style=3D"background-color: transparent; b=
order-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bott=
om-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border=
-image-slice: 100%; border-image-source: none; border-image-width: 1; borde=
r-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: =
0px; border-right-color: rgb(34, 34, 34); border-right-style: none; border-=
right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none=
; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Ari=
al&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; fon=
t-style: normal; font-variant: normal; font-weight: 400; letter-spacing: no=
rmal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: =
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px=
; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0=
px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: norm=
al; word-spacing: 0px;"><br style=3D"background-attachment: scroll; backgro=
und-clip: border-box; background-color: transparent; background-image: none=
; background-origin: padding-box; background-position-x: 0%; background-pos=
ition-y: 0%; background-repeat: repeat; background-size: auto; border-botto=
m-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0=
px; border-image-outset: 0; border-image-repeat: stretch; border-image-slic=
e: 100%; border-image-source: none; border-image-width: 1; border-left-colo=
r: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border=
-right-color: rgb(34, 34, 34); border-right-style: none; border-right-width=
: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-to=
p-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot=
;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; height: auto; =
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; m=
in-width: 0px; overflow: visible; overflow-x: visible; overflow-y: visible;=
padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0=
px;"></div><div style=3D"background-color: transparent; border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&=
quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal; f=
ont-variant: normal; font-weight: 400; letter-spacing: normal; margin-botto=
m: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; p=
adding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px=
; text-align: left; text-decoration: none; text-indent: 0px; text-transform=
: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: =
0px;"><font face=3D"courier new,monospace" style=3D"border-bottom-color: rg=
b(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-=
image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bo=
rder-image-source: none; border-image-width: 1; border-left-color: rgb(34, =
34, 34); border-left-style: none; border-left-width: 0px; border-right-colo=
r: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; bord=
er-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0p=
x; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px=
; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: =
0px;">class string</font></div><div style=3D"background-color: transparent;=
border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bo=
ttom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; bord=
er-image-slice: 100%; border-image-source: none; border-image-width: 1; bor=
der-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width=
: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; borde=
r-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: no=
ne; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;A=
rial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; f=
ont-style: normal; font-variant: normal; font-weight: 400; letter-spacing: =
normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top=
: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0=
px; padding-top: 0px; text-align: left; text-decoration: none; text-indent:=
0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: no=
rmal; word-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"bor=
der-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom=
-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-i=
mage-slice: 100%; border-image-source: none; border-image-width: 1; border-=
left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0p=
x; border-right-color: rgb(34, 34, 34); border-right-style: none; border-ri=
ght-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; =
border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: =
0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right=
: 0px; padding-top: 0px;">{</font></div><div style=3D"background-color: tra=
nsparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; =
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stre=
tch; border-image-slice: 100%; border-image-source: none; border-image-widt=
h: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-l=
eft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: no=
ne; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-=
style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &a=
mp;quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size=
: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-=
spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; m=
argin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding=
-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; tex=
t-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-=
space: normal; word-spacing: 0px;"><font face=3D"courier new,monospace" sty=
le=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bord=
er-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch;=
border-image-slice: 100%; border-image-source: none; border-image-width: 1=
; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-=
width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; =
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-styl=
e: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px;">=C2=A0 ...</font></div><div style=3D"bac=
kground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bo=
ttom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-=
image-repeat: stretch; border-image-slice: 100%; border-image-source: none;=
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-sty=
le: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bord=
er-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34=
, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34=
); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,san=
s-serif; font-size: 13px; font-style: normal; font-variant: normal; font-we=
ight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-dec=
oration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-=
width: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"courier =
new,monospace" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom=
-style: none; border-bottom-width: 0px; border-image-outset: 0; border-imag=
e-repeat: stretch; border-image-slice: 100%; border-image-source: none; bor=
der-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: =
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-r=
ight-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34=
); border-top-style: none; border-top-width: 0px; margin-bottom: 0px; margi=
n-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; paddi=
ng-left: 0px; padding-right: 0px; padding-top: 0px;">=C2=A0 <span style=3D"=
background-color: transparent; border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34,=
34); display: inline; float: none; font-size: 13px; font-style: normal; fo=
nt-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom=
: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; pa=
dding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;=
text-align: left; text-decoration: none; text-indent: 0px; text-transform:=
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0=
px;">[[dependent_lifetime]] operator string_view() && { return {c_s=
tr(), size()}; } //< <span style=3D"background-color: transparent; borde=
r-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-w=
idth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-ima=
ge-slice: 100%; border-image-source: none; border-image-width: 1; border-le=
ft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px;=
border-right-color: rgb(34, 34, 34); border-right-style: none; border-righ=
t-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bo=
rder-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; =
font-family: arial,sans-serif; font-size: 13px; font-style: italic; font-va=
riant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px=
; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding=
-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text=
-align: left; text-decoration: none; text-indent: 0px; text-transform: none=
; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=
(probably not the correct place to set the attribute, but you get the idea)=
</span></span></font></div><div style=3D"background-color: transparent; bor=
der-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom=
-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-i=
mage-slice: 100%; border-image-source: none; border-image-width: 1; border-=
left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0p=
x; border-right-color: rgb(34, 34, 34); border-right-style: none; border-ri=
ght-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; =
border-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial=
&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-=
style: normal; font-variant: normal; font-weight: 400; letter-spacing: norm=
al; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0p=
x; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; =
padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px=
; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal=
; word-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"border-=
bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-wid=
th: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image=
-slice: 100%; border-image-source: none; border-image-width: 1; border-left=
-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; b=
order-right-color: rgb(34, 34, 34); border-right-style: none; border-right-=
width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bord=
er-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;=
margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px;">};</font></div><div style=3D"background-color: transp=
arent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bor=
der-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch=
; border-image-slice: 100%; border-image-source: none; border-image-width: =
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left=
-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none;=
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-sty=
le: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &=
quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 1=
3px; font-style: normal; font-variant: normal; font-weight: 400; letter-spa=
cing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; marg=
in-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-ri=
ght: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-i=
ndent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-spa=
ce: normal; word-spacing: 0px;"><font face=3D"courier new,monospace" style=
=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border=
-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; b=
order-image-slice: 100%; border-image-source: none; border-image-width: 1; =
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-wi=
dth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; bo=
rder-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style:=
none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-=
right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; paddin=
g-right: 0px; padding-top: 0px;"><br style=3D"background-attachment: scroll=
; background-clip: border-box; background-color: transparent; background-im=
age: none; background-origin: padding-box; background-position-x: 0%; backg=
round-position-y: 0%; background-repeat: repeat; background-size: auto; bor=
der-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom=
-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-i=
mage-slice: 100%; border-image-source: none; border-image-width: 1; border-=
left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0p=
x; border-right-color: rgb(34, 34, 34); border-right-style: none; border-ri=
ght-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; =
border-top-width: 0px; color: rgb(34, 34, 34); font-family: courier new,mon=
ospace; font-size: 13px; height: auto; margin-bottom: 0px; margin-left: 0px=
; margin-right: 0px; margin-top: 0px; min-width: 0px; overflow: visible; ov=
erflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: =
0px; padding-right: 0px; padding-top: 0px;"></font></div><div style=3D"back=
ground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bot=
tom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-i=
mage-repeat: stretch; border-image-slice: 100%; border-image-source: none; =
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-styl=
e: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); borde=
r-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34,=
34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34)=
; font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sans=
-serif; font-size: 13px; font-style: normal; font-variant: normal; font-wei=
ght: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; mar=
gin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-l=
eft: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-deco=
ration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-w=
idth: 0px; white-space: normal; word-spacing: 0px;">Now the returned value =
(the variable created from it) depends on the lifetime of *this and should =
not be used after *this is dtor is called.=C2=A0</div><div style=3D"backgro=
und-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom=
-style: none; border-bottom-width: 0px; border-image-outset: 0; border-imag=
e-repeat: stretch; border-image-slice: 100%; border-image-source: none; bor=
der-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: =
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-r=
ight-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34=
); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); f=
ont-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-se=
rif; font-size: 13px; font-style: normal; font-variant: normal; font-weight=
: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin=
-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left=
: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decorat=
ion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-widt=
h: 0px; white-space: normal; word-spacing: 0px;"><br style=3D"background-at=
tachment: scroll; background-clip: border-box; background-color: transparen=
t; background-image: none; background-origin: padding-box; background-posit=
ion-x: 0%; background-position-y: 0%; background-repeat: repeat; background=
-size: auto; border-bottom-color: rgb(34, 34, 34); border-bottom-style: non=
e; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: s=
tretch; border-image-slice: 100%; border-image-source: none; border-image-w=
idth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; borde=
r-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style:=
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-t=
op-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family:=
&quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-s=
ize: 13px; height: auto; margin-bottom: 0px; margin-left: 0px; margin-right=
: 0px; margin-top: 0px; min-width: 0px; overflow: visible; overflow-x: visi=
ble; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-r=
ight: 0px; padding-top: 0px;"></div><div style=3D"background-color: transpa=
rent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bord=
er-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch;=
border-image-slice: 100%; border-image-source: none; border-image-width: 1=
; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-=
width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; =
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-styl=
e: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &q=
uot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13=
px; font-style: normal; font-variant: normal; font-weight: 400; letter-spac=
ing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margi=
n-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-rig=
ht: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-in=
dent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-spac=
e: normal; word-spacing: 0px;"><br></div><div style=3D"background-color: tr=
ansparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none;=
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: str=
etch; border-image-slice: 100%; border-image-source: none; border-image-wid=
th: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-=
left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: n=
one; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top=
-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &=
amp;quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-siz=
e: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter=
-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; =
margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; paddin=
g-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; te=
xt-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white=
-space: normal; word-spacing: 0px;"><br style=3D"background-attachment: scr=
oll; background-clip: border-box; background-color: transparent; background=
-image: none; background-origin: padding-box; background-position-x: 0%; ba=
ckground-position-y: 0%; background-repeat: repeat; background-size: auto; =
border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bot=
tom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; borde=
r-image-slice: 100%; border-image-source: none; border-image-width: 1; bord=
er-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width:=
0px; border-right-color: rgb(34, 34, 34); border-right-style: none; border=
-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: non=
e; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Ar=
ial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; he=
ight: auto; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin=
-top: 0px; min-width: 0px; overflow: visible; overflow-x: visible; overflow=
-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; pa=
dding-top: 0px;"></div><div style=3D"background-color: transparent; border-=
bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-wid=
th: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image=
-slice: 100%; border-image-source: none; border-image-width: 1; border-left=
-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; b=
order-right-color: rgb(34, 34, 34); border-right-style: none; border-right-=
width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bord=
er-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&=
;quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-styl=
e: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; =
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; o=
rphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; te=
xt-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; wo=
rd-spacing: 0px;"><b style=3D"background-attachment: scroll; background-cli=
p: border-box; background-color: transparent; background-image: none; backg=
round-origin: padding-box; background-position-x: 0%; background-position-y=
: 0%; background-repeat: repeat; background-size: auto; border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&=
quot;Helvetica&quot;,sans-serif; font-size: 13px; height: auto; margin-=
bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-widt=
h: 0px; overflow: visible; overflow-x: visible; overflow-y: visible; paddin=
g-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Fu=
rther investigation=C2=A0</b></div><div style=3D"background-color: transpar=
ent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; borde=
r-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; =
border-image-slice: 100%; border-image-source: none; border-image-width: 1;=
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-w=
idth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; b=
order-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style=
: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &qu=
ot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13p=
x; font-style: normal; font-variant: normal; font-weight: 400; letter-spaci=
ng: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin=
-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-righ=
t: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-ind=
ent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space=
: normal; word-spacing: 0px;"><b style=3D"background-attachment: scroll; ba=
ckground-clip: border-box; background-color: transparent; background-image:=
none; background-origin: padding-box; background-position-x: 0%; backgroun=
d-position-y: 0%; background-repeat: repeat; background-size: auto; border-=
bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-wid=
th: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image=
-slice: 100%; border-image-source: none; border-image-width: 1; border-left=
-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; b=
order-right-color: rgb(34, 34, 34); border-right-style: none; border-right-=
width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bord=
er-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&=
;quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; height: a=
uto; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0=
px; min-width: 0px; overflow: visible; overflow-x: visible; overflow-y: vis=
ible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-t=
op: 0px;"><br style=3D"background-attachment: scroll; background-clip: bord=
er-box; background-color: transparent; background-image: none; background-o=
rigin: padding-box; background-position-x: 0%; background-position-y: 0%; b=
ackground-repeat: repeat; background-size: auto; border-bottom-color: rgb(3=
4, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-ima=
ge-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; borde=
r-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34,=
34); border-left-style: none; border-left-width: 0px; border-right-color: =
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-=
top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; =
color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;He=
lvetica&quot;,sans-serif; font-size: 13px; height: auto; margin-bottom:=
0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-width: 0px;=
overflow: visible; overflow-x: visible; overflow-y: visible; padding-botto=
m: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></b></div=
><div style=3D"background-color: transparent; border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; col=
or: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Helve=
tica&quot;,sans-serif; font-size: 13px; font-style: normal; font-varian=
t: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; ma=
rgin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bot=
tom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-ali=
gn: left; text-decoration: none; text-indent: 0px; text-transform: none; -w=
ebkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><br =
style=3D"background-attachment: scroll; background-clip: border-box; backgr=
ound-color: transparent; background-image: none; background-origin: padding=
-box; background-position-x: 0%; background-position-y: 0%; background-repe=
at: repeat; background-size: auto; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); font-family: &quot;Arial&quot;,&quot;Helvetica&qu=
ot;,sans-serif; font-size: 13px; height: auto; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; min-width: 0px; overflow: vis=
ible; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; paddin=
g-left: 0px; padding-right: 0px; padding-top: 0px;"></div><div style=3D"bac=
kground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bo=
ttom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-=
image-repeat: stretch; border-image-slice: 100%; border-image-source: none;=
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-sty=
le: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bord=
er-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34=
, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34=
); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,san=
s-serif; font-size: 13px; font-style: normal; font-variant: normal; font-we=
ight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-dec=
oration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-=
width: 0px; white-space: normal; word-spacing: 0px;">Consider that case:</d=
iv><div style=3D"background-color: transparent; border-bottom-color: rgb(34=
, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-imag=
e-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border=
-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, =
34); border-left-style: none; border-left-width: 0px; border-right-color: r=
gb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-t=
op-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; c=
olor: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Hel=
vetica&quot;,sans-serif; font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; =
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-a=
lign: left; text-decoration: none; text-indent: 0px; text-transform: none; =
-webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><s=
pan style=3D"background-color: transparent; border-bottom-color: rgb(34, 34=
, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-ou=
tset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-ima=
ge-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34);=
border-left-style: none; border-left-width: 0px; border-right-color: rgb(3=
4, 34, 34); border-right-style: none; border-right-width: 0px; border-top-c=
olor: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color=
: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-styl=
e: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; =
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; o=
rphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; te=
xt-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; wo=
rd-spacing: 0px;"><br style=3D"border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; margin-bottom: 0px=
; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px=
; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></span></div><d=
iv style=3D"background-color: transparent; border-bottom-color: rgb(34, 34,=
34); border-bottom-style: none; border-bottom-width: 0px; border-image-out=
set: 0; border-image-repeat: stretch; border-image-slice: 100%; border-imag=
e-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); =
border-left-style: none; border-left-width: 0px; border-right-color: rgb(34=
, 34, 34); border-right-style: none; border-right-width: 0px; border-top-co=
lor: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color:=
rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Helvetic=
a&quot;,sans-serif; font-size: 13px; font-style: normal; font-variant: =
normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margi=
n-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom=
: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align:=
left; text-decoration: none; text-indent: 0px; text-transform: none; -webk=
it-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span s=
tyle=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34)=
; border-bottom-style: none; border-bottom-width: 0px; border-image-outset:=
0; border-image-repeat: stretch; border-image-slice: 100%; border-image-so=
urce: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bord=
er-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34=
, 34); border-right-style: none; border-right-width: 0px; border-top-color:=
rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb=
(34, 34, 34); display: inline; float: none; font-size: 13px; font-style: no=
rmal; font-variant: normal; font-weight: 400; letter-spacing: normal; margi=
n-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphan=
s: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-t=
op: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-tr=
ansform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-sp=
acing: 0px;"><font face=3D"courier new,monospace" style=3D"border-bottom-co=
lor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; =
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 1=
00%; border-image-source: none; border-image-width: 1; border-left-color: r=
gb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-rig=
ht-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0p=
x; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wi=
dth: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-t=
op: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; paddin=
g-top: 0px;">void f()</font></span></div><div style=3D"background-color: tr=
ansparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none;=
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: str=
etch; border-image-slice: 100%; border-image-source: none; border-image-wid=
th: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-=
left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: n=
one; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top=
-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &=
amp;quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-siz=
e: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter=
-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; =
margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; paddin=
g-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; te=
xt-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white=
-space: normal; word-spacing: 0px;"><span style=3D"background-color: transp=
arent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bor=
der-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch=
; border-image-slice: 100%; border-image-source: none; border-image-width: =
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left=
-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none;=
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-sty=
le: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; f=
loat: none; font-size: 13px; font-style: normal; font-variant: normal; font=
-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px;=
margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; paddi=
ng-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-=
decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stro=
ke-width: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"couri=
er new,monospace" style=3D"border-bottom-color: rgb(34, 34, 34); border-bot=
tom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-i=
mage-repeat: stretch; border-image-slice: 100%; border-image-source: none; =
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-styl=
e: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); borde=
r-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34,=
34); border-top-style: none; border-top-width: 0px; margin-bottom: 0px; ma=
rgin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; pa=
dding-left: 0px; padding-right: 0px; padding-top: 0px;">{</font></span></di=
v><div style=3D"background-color: transparent; border-bottom-color: rgb(34,=
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image=
-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-=
image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 3=
4); border-left-style: none; border-left-width: 0px; border-right-color: rg=
b(34, 34, 34); border-right-style: none; border-right-width: 0px; border-to=
p-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; co=
lor: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Helv=
etica&quot;,sans-serif; font-size: 13px; font-style: normal; font-varia=
nt: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; m=
argin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bo=
ttom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-al=
ign: left; text-decoration: none; text-indent: 0px; text-transform: none; -=
webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=C2=
=A0 <span style=3D"background-color: transparent; border-bottom-color: rgb(=
34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-im=
age-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bord=
er-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34=
, 34); border-left-style: none; border-left-width: 0px; border-right-color:=
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border=
-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px;=
color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; fon=
t-style: normal; font-variant: normal; font-weight: 400; letter-spacing: no=
rmal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: =
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px=
; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0=
px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: norm=
al; word-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"borde=
r-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-w=
idth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-ima=
ge-slice: 100%; border-image-source: none; border-image-width: 1; border-le=
ft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px;=
border-right-color: rgb(34, 34, 34); border-right-style: none; border-righ=
t-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bo=
rder-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0p=
x; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: =
0px; padding-top: 0px;"><span style=3D"background-color: transparent; borde=
r-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-w=
idth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-ima=
ge-slice: 100%; border-image-source: none; border-image-width: 1; border-le=
ft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px;=
border-right-color: rgb(34, 34, 34); border-right-style: none; border-righ=
t-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bo=
rder-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; =
font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400=
; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-righ=
t: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px=
; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration: =
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0p=
x; white-space: normal; word-spacing: 0px;">string_view v;</span></font></s=
pan></div><div style=3D"background-color: transparent; border-bottom-color:=
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bord=
er-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%;=
border-image-source: none; border-image-width: 1; border-left-color: rgb(3=
4, 34, 34); border-left-style: none; border-left-width: 0px; border-right-c=
olor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; b=
order-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width:=
0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&q=
uot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal; fo=
nt-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom=
: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; pa=
dding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;=
text-align: left; text-decoration: none; text-indent: 0px; text-transform:=
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0=
px;"><span style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; fo=
nt-style: normal; font-variant: normal; font-weight: 400; letter-spacing: n=
ormal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px; text-align: left; text-decoration: none; text-indent: =
0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: nor=
mal; word-spacing: 0px;"><span style=3D"background-color: transparent; bord=
er-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-=
width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-im=
age-slice: 100%; border-image-source: none; border-image-width: 1; border-l=
eft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px=
; border-right-color: rgb(34, 34, 34); border-right-style: none; border-rig=
ht-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; b=
order-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none;=
font-size: 13px; font-style: normal; font-variant: normal; font-weight: 40=
0; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-rig=
ht: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;"><font face=3D"courier new,mono=
space" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: =
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat=
: stretch; border-image-slice: 100%; border-image-source: none; border-imag=
e-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bo=
rder-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-sty=
le: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); borde=
r-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left:=
0px; padding-right: 0px; padding-top: 0px;">=C2=A0</font></span></span></d=
iv><div style=3D"background-color: transparent; border-bottom-color: rgb(34=
, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-imag=
e-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border=
-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, =
34); border-left-style: none; border-left-width: 0px; border-right-color: r=
gb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-t=
op-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; c=
olor: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Hel=
vetica&quot;,sans-serif; font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; =
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-a=
lign: left; text-decoration: none; text-indent: 0px; text-transform: none; =
-webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><s=
pan style=3D"background-color: transparent; border-bottom-color: rgb(34, 34=
, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-ou=
tset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-ima=
ge-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34);=
border-left-style: none; border-left-width: 0px; border-right-color: rgb(3=
4, 34, 34); border-right-style: none; border-right-width: 0px; border-top-c=
olor: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color=
: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-styl=
e: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; =
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; o=
rphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; te=
xt-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; wo=
rd-spacing: 0px;"><span style=3D"background-color: transparent; border-bott=
om-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: =
0px; border-image-outset: 0; border-image-repeat: stretch; border-image-sli=
ce: 100%; border-image-source: none; border-image-width: 1; border-left-col=
or: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; borde=
r-right-color: rgb(34, 34, 34); border-right-style: none; border-right-widt=
h: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-t=
op-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-s=
ize: 13px; font-style: normal; font-variant: normal; font-weight: 400; lett=
er-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px=
; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; =
text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whi=
te-space: normal; word-spacing: 0px;"><font face=3D"courier new,monospace" =
style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; b=
order-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stret=
ch; border-image-slice: 100%; border-image-source: none; border-image-width=
: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-le=
ft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: non=
e; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-s=
tyle: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; p=
adding-right: 0px; padding-top: 0px;">=C2=A0if(const auto str =3D getString=
(); str =3D=3D "something")</font></span></span></div><div style=
=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); font-family: &quot;Arial&quot;,&quot;Helvetica&qu=
ot;,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; =
font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; p=
adding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; t=
ext-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-=
stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"=
background-color: transparent; border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34,=
34); display: inline; float: none; font-size: 13px; font-style: normal; fo=
nt-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom=
: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; pa=
dding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;=
text-align: left; text-decoration: none; text-indent: 0px; text-transform:=
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0=
px;"><span style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; fo=
nt-style: normal; font-variant: normal; font-weight: 400; letter-spacing: n=
ormal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px; text-align: left; text-decoration: none; text-indent: =
0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: nor=
mal; word-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"bord=
er-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-=
width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-im=
age-slice: 100%; border-image-source: none; border-image-width: 1; border-l=
eft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px=
; border-right-color: rgb(34, 34, 34); border-right-style: none; border-rig=
ht-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; b=
order-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0=
px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right:=
0px; padding-top: 0px;">=C2=A0{</font></span></span></div><div style=3D"ba=
ckground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-b=
ottom-style: none; border-bottom-width: 0px; border-image-outset: 0; border=
-image-repeat: stretch; border-image-slice: 100%; border-image-source: none=
; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-st=
yle: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bor=
der-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 3=
4, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 3=
4); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sa=
ns-serif; font-size: 13px; font-style: normal; font-variant: normal; font-w=
eight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; m=
argin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding=
-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-de=
coration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke=
-width: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"courier=
new" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: n=
one; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat:=
stretch; border-image-slice: 100%; border-image-source: none; border-image=
-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bor=
der-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-styl=
e: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border=
-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0=
px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: =
0px; padding-right: 0px; padding-top: 0px;"><span style=3D"background-color=
: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: n=
one; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat:=
stretch; border-image-slice: 100%; border-image-source: none; border-image=
-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bor=
der-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-styl=
e: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border=
-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: i=
nline; float: none; font-size: 13px; font-style: normal; font-variant: norm=
al; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-le=
ft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0p=
x; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: lef=
t; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-t=
ext-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span style=
=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); display: inline; float: none; font-size: 13px; font-style: normal=
; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bo=
ttom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2=
; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: =
0px; text-align: left; text-decoration: none; text-indent: 0px; text-transf=
orm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacin=
g: 0px;">=C2=A0 =C2=A0 </span></span>v =3D str;</font></div><div style=3D"b=
ackground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-=
bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; borde=
r-image-repeat: stretch; border-image-slice: 100%; border-image-source: non=
e; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-s=
tyle: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bo=
rder-right-style: none; border-right-width: 0px; border-top-color: rgb(34, =
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, =
34); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,s=
ans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-=
weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; =
margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; paddin=
g-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-d=
ecoration: none; text-indent: 0px; text-transform: none; -webkit-text-strok=
e-width: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"backg=
round-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bott=
om-style: none; border-bottom-width: 0px; border-image-outset: 0; border-im=
age-repeat: stretch; border-image-slice: 100%; border-image-source: none; b=
order-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style=
: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border=
-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, =
34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34);=
display: inline; float: none; font-size: 13px; font-style: normal; font-va=
riant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px=
; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding=
-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text=
-align: left; text-decoration: none; text-indent: 0px; text-transform: none=
; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=
<span style=3D"background-color: transparent; border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; col=
or: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-st=
yle: normal; font-variant: normal; font-weight: 400; letter-spacing: normal=
; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;=
orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; pa=
dding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; =
text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; =
word-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"border-bo=
ttom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width=
: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-s=
lice: 100%; border-image-source: none; border-image-width: 1; border-left-c=
olor: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; bor=
der-right-color: rgb(34, 34, 34); border-right-style: none; border-right-wi=
dth: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border=
-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; m=
argin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;=
padding-top: 0px;">=C2=A0}</font></span></span></div><div style=3D"backgro=
und-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom=
-style: none; border-bottom-width: 0px; border-image-outset: 0; border-imag=
e-repeat: stretch; border-image-slice: 100%; border-image-source: none; bor=
der-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: =
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-r=
ight-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34=
); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); f=
ont-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-se=
rif; font-size: 13px; font-style: normal; font-variant: normal; font-weight=
: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin=
-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left=
: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decorat=
ion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-widt=
h: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"background-=
color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-sty=
le: none; border-bottom-width: 0px; border-image-outset: 0; border-image-re=
peat: stretch; border-image-slice: 100%; border-image-source: none; border-=
image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none=
; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right=
-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); b=
order-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); displ=
ay: inline; float: none; font-size: 13px; font-style: normal; font-variant:=
normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; marg=
in-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-botto=
m: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align=
: left; text-decoration: none; text-indent: 0px; text-transform: none; -web=
kit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span =
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34=
); border-bottom-style: none; border-bottom-width: 0px; border-image-outset=
: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-s=
ource: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bor=
der-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 3=
4, 34); border-right-style: none; border-right-width: 0px; border-top-color=
: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rg=
b(34, 34, 34); display: inline; float: none; font-size: 13px; font-style: n=
ormal; font-variant: normal; font-weight: 400; letter-spacing: normal; marg=
in-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orpha=
ns: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-=
top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-t=
ransform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-s=
pacing: 0px;"><font face=3D"courier new,monospace" style=3D"border-bottom-c=
olor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px;=
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: =
100%; border-image-source: none; border-image-width: 1; border-left-color: =
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-ri=
ght-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0=
px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-w=
idth: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-=
top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; paddi=
ng-top: 0px;">=C2=A0=C2=A0</font></span></span></div><div style=3D"backgrou=
nd-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-=
style: none; border-bottom-width: 0px; border-image-outset: 0; border-image=
-repeat: stretch; border-image-slice: 100%; border-image-source: none; bord=
er-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: n=
one; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-ri=
ght-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34)=
; border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); fo=
nt-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-ser=
if; font-size: 13px; font-style: normal; font-variant: normal; font-weight:=
400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-=
right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left:=
0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decorati=
on: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width=
: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"background-c=
olor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-styl=
e: none; border-bottom-width: 0px; border-image-outset: 0; border-image-rep=
eat: stretch; border-image-slice: 100%; border-image-source: none; border-i=
mage-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none;=
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-=
style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bo=
rder-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); displa=
y: inline; float: none; font-size: 13px; font-variant: normal; font-weight:=
400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-=
right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left:=
0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decorati=
on: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width=
: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"background-c=
olor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-styl=
e: none; border-bottom-width: 0px; border-image-outset: 0; border-image-rep=
eat: stretch; border-image-slice: 100%; border-image-source: none; border-i=
mage-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none;=
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-=
style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bo=
rder-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); displa=
y: inline; float: none; font-size: 13px; font-variant: normal; font-weight:=
400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-=
right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left:=
0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decorati=
on: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width=
: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"courier new" =
style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; b=
order-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stret=
ch; border-image-slice: 100%; border-image-source: none; border-image-width=
: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-le=
ft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: non=
e; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-s=
tyle: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; p=
adding-right: 0px; padding-top: 0px;"><i style=3D"border-bottom-color: rgb(=
34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-im=
age-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bord=
er-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34=
, 34); border-left-style: none; border-left-width: 0px; border-right-color:=
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border=
-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px;=
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; =
padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0p=
x;">=C2=A0// 'v' is either empty or dangles!</i></font></span></spa=
n><span style=3D"background-color: transparent; border-bottom-color: rgb(34=
, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-imag=
e-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border=
-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, =
34); border-left-style: none; border-left-width: 0px; border-right-color: r=
gb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-t=
op-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; c=
olor: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-=
variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0=
px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; paddi=
ng-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; te=
xt-align: left; text-decoration: none; text-indent: 0px; text-transform: no=
ne; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;=
"><b style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: no=
ne; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: =
stretch; border-image-slice: 100%; border-image-source: none; border-image-=
width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bord=
er-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style=
: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-=
top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0p=
x; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0=
px; padding-right: 0px; padding-top: 0px;"><font face=3D"courier new,monosp=
ace" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: no=
ne; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: =
stretch; border-image-slice: 100%; border-image-source: none; border-image-=
width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bord=
er-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style=
: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-=
top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0p=
x; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0=
px; padding-right: 0px; padding-top: 0px;"></font></b></span></div><div sty=
le=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); =
border-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0=
; border-image-repeat: stretch; border-image-slice: 100%; border-image-sour=
ce: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border=
-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, =
34); border-right-style: none; border-right-width: 0px; border-top-color: r=
gb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(3=
4, 34, 34); font-family: &quot;Arial&quot;,&quot;Helvetica&=
quot;,sans-serif; font-size: 13px; font-style: normal; font-variant: normal=
; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left=
: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px;=
padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;=
text-decoration: none; text-indent: 0px; text-transform: none; -webkit-tex=
t-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span style=
=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); display: inline; float: none; font-size: 13px; font-style: normal=
; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bo=
ttom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2=
; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: =
0px; text-align: left; text-decoration: none; text-indent: 0px; text-transf=
orm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacin=
g: 0px;"><font face=3D"courier new,monospace" style=3D"border-bottom-color:=
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bord=
er-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%;=
border-image-source: none; border-image-width: 1; border-left-color: rgb(3=
4, 34, 34); border-left-style: none; border-left-width: 0px; border-right-c=
olor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; b=
order-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width:=
0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: =
0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-to=
p: 0px;">}</font></span></div><div style=3D"background-color: transparent; =
border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bot=
tom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; borde=
r-image-slice: 100%; border-image-source: none; border-image-width: 1; bord=
er-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width:=
0px; border-right-color: rgb(34, 34, 34); border-right-style: none; border=
-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: non=
e; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Ar=
ial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; fo=
nt-style: normal; font-variant: normal; font-weight: 400; letter-spacing: n=
ormal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px; text-align: left; text-decoration: none; text-indent: =
0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: nor=
mal; word-spacing: 0px;"><span style=3D"background-color: transparent; bord=
er-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-=
width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-im=
age-slice: 100%; border-image-source: none; border-image-width: 1; border-l=
eft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px=
; border-right-color: rgb(34, 34, 34); border-right-style: none; border-rig=
ht-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; b=
order-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none;=
font-size: 13px; font-style: normal; font-variant: normal; font-weight: 40=
0; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-rig=
ht: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;"><font face=3D"courier new" sty=
le=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bord=
er-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch;=
border-image-slice: 100%; border-image-source: none; border-image-width: 1=
; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-=
width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; =
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-styl=
e: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px;"><br style=3D"border-bottom-color: rgb(34=
, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-imag=
e-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border=
-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, =
34); border-left-style: none; border-left-width: 0px; border-right-color: r=
gb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-t=
op-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; m=
argin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; pa=
dding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;=
"></font></span></div><div style=3D"background-color: transparent; border-b=
ottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-widt=
h: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-=
slice: 100%; border-image-source: none; border-image-width: 1; border-left-=
color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; bo=
rder-right-color: rgb(34, 34, 34); border-right-style: none; border-right-w=
idth: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; borde=
r-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&=
quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style=
: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; m=
argin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; or=
phans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; paddi=
ng-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; tex=
t-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; wor=
d-spacing: 0px;"><span style=3D"background-color: transparent; border-botto=
m-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0=
px; border-image-outset: 0; border-image-repeat: stretch; border-image-slic=
e: 100%; border-image-source: none; border-image-width: 1; border-left-colo=
r: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border=
-right-color: rgb(34, 34, 34); border-right-style: none; border-right-width=
: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-to=
p-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-si=
ze: 13px; font-style: normal; font-variant: normal; font-weight: 400; lette=
r-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;=
margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; paddi=
ng-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; t=
ext-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whit=
e-space: normal; word-spacing: 0px;"><font face=3D"arial,sans-serif" style=
=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border=
-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; b=
order-image-slice: 100%; border-image-source: none; border-image-width: 1; =
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-wi=
dth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; bo=
rder-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style:=
none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-=
right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; paddin=
g-right: 0px; padding-top: 0px;">The above mistake can happen even to an ex=
perienced programmer (if he is used to ref-counted strings for instance). P=
eople learning C++ and junior developers are basically guaranteed to fall i=
n there at some point.</font></span></div><div style=3D"background-color: t=
ransparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none=
; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: st=
retch; border-image-slice: 100%; border-image-source: none; border-image-wi=
dth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border=
-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: =
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-to=
p-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: =
&quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-si=
ze: 13px; font-style: normal; font-variant: normal; font-weight: 400; lette=
r-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;=
margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; paddi=
ng-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; t=
ext-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whit=
e-space: normal; word-spacing: 0px;"><span style=3D"background-color: trans=
parent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bo=
rder-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretc=
h; border-image-slice: 100%; border-image-source: none; border-image-width:=
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-lef=
t-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none=
; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-st=
yle: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; =
float: none; font-size: 13px; font-style: normal; font-variant: normal; fon=
t-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px=
; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padd=
ing-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text=
-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-str=
oke-width: 0px; white-space: normal; word-spacing: 0px;"><br style=3D"borde=
r-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-w=
idth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-ima=
ge-slice: 100%; border-image-source: none; border-image-width: 1; border-le=
ft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px;=
border-right-color: rgb(34, 34, 34); border-right-style: none; border-righ=
t-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bo=
rder-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0p=
x; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: =
0px; padding-top: 0px;"></span></div><div style=3D"background-color: transp=
arent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bor=
der-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch=
; border-image-slice: 100%; border-image-source: none; border-image-width: =
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left=
-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none;=
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-sty=
le: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &=
quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 1=
3px; font-style: normal; font-variant: normal; font-weight: 400; letter-spa=
cing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; marg=
in-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-ri=
ght: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-i=
ndent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-spa=
ce: normal; word-spacing: 0px;">H<span style=3D"background-color: transpare=
nt; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border=
-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; b=
order-image-slice: 100%; border-image-source: none; border-image-width: 1; =
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-wi=
dth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; bo=
rder-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style:=
none; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; floa=
t: none; font-size: 13px; font-style: normal; font-variant: normal; font-we=
ight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-dec=
oration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-=
width: 0px; white-space: normal; word-spacing: 0px;">ere it is <i style=3D"=
border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bot=
tom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; borde=
r-image-slice: 100%; border-image-source: none; border-image-width: 1; bord=
er-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width:=
0px; border-right-color: rgb(34, 34, 34); border-right-style: none; border=
-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: non=
e; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-righ=
t: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-ri=
ght: 0px; padding-top: 0px;">painfully</i> obvious the compiler knows the r=
ight usage - he just keeps it shut! We <i style=3D"border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;=
padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0=
px;">should</i> be able to make him speak.</span></div><div style=3D"backgr=
ound-color: transparent; border-bottom-color: rgb(34, 34, 34); border-botto=
m-style: none; border-bottom-width: 0px; border-image-outset: 0; border-ima=
ge-repeat: stretch; border-image-slice: 100%; border-image-source: none; bo=
rder-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style:=
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-=
right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 3=
4); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); =
font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-s=
erif; font-size: 13px; font-style: normal; font-variant: normal; font-weigh=
t: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decora=
tion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"background=
-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); disp=
lay: inline; float: none; font-size: 13px; font-style: normal; font-variant=
: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; mar=
gin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-alig=
n: left; text-decoration: none; text-indent: 0px; text-transform: none; -we=
bkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><br s=
tyle=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bo=
rder-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretc=
h; border-image-slice: 100%; border-image-source: none; border-image-width:=
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-lef=
t-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none=
; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-st=
yle: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; mar=
gin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; pa=
dding-right: 0px; padding-top: 0px;"></span></div><div style=3D"background-=
color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-sty=
le: none; border-bottom-width: 0px; border-image-outset: 0; border-image-re=
peat: stretch; border-image-slice: 100%; border-image-source: none; border-=
image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none=
; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right=
-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); b=
order-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-=
family: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif;=
font-size: 13px; font-style: normal; font-variant: normal; font-weight: 40=
0; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-rig=
ht: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;"><span style=3D"background-colo=
r: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: =
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat=
: stretch; border-image-slice: 100%; border-image-source: none; border-imag=
e-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bo=
rder-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-sty=
le: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); borde=
r-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: =
inline; float: none; font-size: 13px; font-style: normal; font-variant: nor=
mal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0=
px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: le=
ft; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-=
text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">BTW, that =
is an interesting case, as it is not about initialization, but assignment. =
However, does it matter? It is still clear the scope of tracking - from ass=
ignment tor dtor.</span></div><div style=3D"background-color: transparent; =
border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bot=
tom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; borde=
r-image-slice: 100%; border-image-source: none; border-image-width: 1; bord=
er-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width:=
0px; border-right-color: rgb(34, 34, 34); border-right-style: none; border=
-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: non=
e; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Ar=
ial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; fo=
nt-style: normal; font-variant: normal; font-weight: 400; letter-spacing: n=
ormal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px; text-align: left; text-decoration: none; text-indent: =
0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: nor=
mal; word-spacing: 0px;"><span style=3D"background-color: transparent; bord=
er-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-=
width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-im=
age-slice: 100%; border-image-source: none; border-image-width: 1; border-l=
eft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px=
; border-right-color: rgb(34, 34, 34); border-right-style: none; border-rig=
ht-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; b=
order-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none;=
font-size: 13px; font-style: normal; font-variant: normal; font-weight: 40=
0; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-rig=
ht: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;"><br style=3D"border-bottom-col=
or: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; b=
order-image-outset: 0; border-image-repeat: stretch; border-image-slice: 10=
0%; border-image-source: none; border-image-width: 1; border-left-color: rg=
b(34, 34, 34); border-left-style: none; border-left-width: 0px; border-righ=
t-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px=
; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wid=
th: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-to=
p: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding=
-top: 0px;"></span></div><div style=3D"background-color: transparent; borde=
r-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-w=
idth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-ima=
ge-slice: 100%; border-image-source: none; border-image-width: 1; border-le=
ft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px;=
border-right-color: rgb(34, 34, 34); border-right-style: none; border-righ=
t-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bo=
rder-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&a=
mp;quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-st=
yle: normal; font-variant: normal; font-weight: 400; letter-spacing: normal=
; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;=
orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; pa=
dding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; =
text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; =
word-spacing: 0px;"><span style=3D"background-color: transparent; border-bo=
ttom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width=
: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-s=
lice: 100%; border-image-source: none; border-image-width: 1; border-left-c=
olor: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; bor=
der-right-color: rgb(34, 34, 34); border-right-style: none; border-right-wi=
dth: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border=
-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font=
-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; le=
tter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0=
px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pa=
dding-right: 0px; padding-top: 0px; text-align: left; text-decoration: none=
; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; w=
hite-space: normal; word-spacing: 0px;">Even if we have a more involved cas=
e</span></div><div style=3D"background-color: transparent; border-bottom-co=
lor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; =
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 1=
00%; border-image-source: none; border-image-width: 1; border-left-color: r=
gb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-rig=
ht-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0p=
x; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wi=
dth: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&a=
mp;quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal=
; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bo=
ttom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2=
; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: =
0px; text-align: left; text-decoration: none; text-indent: 0px; text-transf=
orm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacin=
g: 0px;"><span style=3D"background-color: transparent; border-bottom-color:=
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bord=
er-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%;=
border-image-source: none; border-image-width: 1; border-left-color: rgb(3=
4, 34, 34); border-left-style: none; border-left-width: 0px; border-right-c=
olor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; b=
order-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width:=
0px; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px=
; font-style: normal; font-variant: normal; font-weight: 400; letter-spacin=
g: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-=
top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right=
: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-inde=
nt: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space:=
normal; word-spacing: 0px;"><b style=3D"border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><font=
face=3D"courier new,monospace" style=3D"border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><br s=
tyle=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bo=
rder-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretc=
h; border-image-slice: 100%; border-image-source: none; border-image-width:=
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-lef=
t-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none=
; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-st=
yle: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; mar=
gin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; pa=
dding-right: 0px; padding-top: 0px;"></font></b></span></div><div style=3D"=
background-color: transparent; border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34,=
34); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,=
sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font=
-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px;=
margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; paddi=
ng-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-=
decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stro=
ke-width: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"back=
ground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bot=
tom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-i=
mage-repeat: stretch; border-image-slice: 100%; border-image-source: none; =
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-styl=
e: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); borde=
r-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34,=
34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34)=
; display: inline; float: none; font-size: 13px; font-variant: normal; lett=
er-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px=
; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-=
transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-=
spacing: 0px;"><div style=3D"background-color: transparent; border-bottom-c=
olor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px;=
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: =
100%; border-image-source: none; border-image-width: 1; border-left-color: =
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-ri=
ght-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0=
px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-w=
idth: 0px; color: rgb(34, 34, 34); font-size: 13px; font-style: normal; fon=
t-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom:=
0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; pad=
ding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; =
text-align: left; text-decoration: none; text-indent: 0px; text-transform: =
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0p=
x;"><span style=3D"background-color: transparent; border-bottom-color: rgb(=
34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-im=
age-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bord=
er-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34=
, 34); border-left-style: none; border-left-width: 0px; border-right-color:=
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border=
-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px;=
color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; fon=
t-style: normal; font-variant: normal; font-weight: 400; letter-spacing: no=
rmal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: =
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px=
; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0=
px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: norm=
al; word-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"borde=
r-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-w=
idth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-ima=
ge-slice: 100%; border-image-source: none; border-image-width: 1; border-le=
ft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px;=
border-right-color: rgb(34, 34, 34); border-right-style: none; border-righ=
t-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bo=
rder-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0p=
x; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: =
0px; padding-top: 0px;">void f(<span style=3D"background-color: transparent=
; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-b=
ottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; bor=
der-image-slice: 100%; border-image-source: none; border-image-width: 1; bo=
rder-left-color: rgb(34, 34, 34); border-left-style: none; border-left-widt=
h: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; bord=
er-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: n=
one; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; float:=
none; font-family: &quot;Arial&quot;,&quot;Helvetica&quot;=
,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; fon=
t-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px=
; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padd=
ing-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text=
-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-str=
oke-width: 0px; white-space: normal; word-spacing: 0px;"> </span><span styl=
e=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); b=
order-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0;=
border-image-repeat: stretch; border-image-slice: 100%; border-image-sourc=
e: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-=
left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 3=
4); border-right-style: none; border-right-width: 0px; border-top-color: rg=
b(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34=
, 34, 34); display: inline; float: none; font-size: 13px; font-style: norma=
l; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: =
2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top:=
0px; text-align: left; text-decoration: none; text-indent: 0px; text-trans=
form: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spaci=
ng: 0px;"><font face=3D"courier new,monospace" style=3D"border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-t=
op: 0px;"><span style=3D"background-color: transparent; border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-family: c=
ourier new,monospace; font-size: 13px; font-style: normal; font-variant: no=
rmal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-=
left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: =
0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: l=
eft; text-decoration: none; text-indent: 0px; text-transform: none; -webkit=
-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">string_vi=
ew& v</span></font></span>)</font></span></div><div style=3D"background=
-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font=
-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; le=
tter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0=
px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pa=
dding-right: 0px; padding-top: 0px; text-align: left; text-decoration: none=
; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; w=
hite-space: normal; word-spacing: 0px;"><span style=3D"background-color: tr=
ansparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none;=
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: str=
etch; border-image-slice: 100%; border-image-source: none; border-image-wid=
th: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-=
left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: n=
one; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top=
-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inlin=
e; float: none; font-size: 13px; font-style: normal; font-variant: normal; =
font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; p=
adding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; t=
ext-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-=
stroke-width: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"c=
ourier new,monospace" style=3D"border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; margin-bottom: 0px=
; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px=
; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{</font></span>=
</div><div style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); font-size: 13px; font-style: normal; font-variant=
: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; mar=
gin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-alig=
n: left; text-decoration: none; text-indent: 0px; text-transform: none; -we=
bkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span=
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: r=
gb(34, 34, 34); display: inline; float: none; font-size: 13px; font-style: =
normal; font-variant: normal; font-weight: 400; letter-spacing: normal; mar=
gin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orph=
ans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding=
-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-=
transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-=
spacing: 0px;"><span style=3D"background-color: transparent; border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
100%; border-image-source: none; border-image-width: 1; border-left-color:=
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-size=
: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-=
spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; m=
argin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding=
-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; tex=
t-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-=
space: normal; word-spacing: 0px;"><font face=3D"courier new,monospace" sty=
le=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bord=
er-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch;=
border-image-slice: 100%; border-image-source: none; border-image-width: 1=
; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-=
width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; =
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-styl=
e: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px;">=C2=A0if(const auto str =3D getString();=
str =3D=3D "something")</font></span></span></div><div style=3D"=
background-color: transparent; border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34,=
34); font-size: 13px; font-style: normal; font-variant: normal; font-weigh=
t: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decora=
tion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"background=
-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); disp=
lay: inline; float: none; font-size: 13px; font-style: normal; font-variant=
: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; mar=
gin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-alig=
n: left; text-decoration: none; text-indent: 0px; text-transform: none; -we=
bkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span=
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: r=
gb(34, 34, 34); display: inline; float: none; font-size: 13px; font-style: =
normal; font-variant: normal; font-weight: 400; letter-spacing: normal; mar=
gin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orph=
ans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding=
-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-=
transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-=
spacing: 0px;"><font face=3D"courier new,monospace" style=3D"border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
100%; border-image-source: none; border-image-width: 1; border-left-color:=
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin=
-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px;">=C2=A0{</font></span></span></div><div style=3D"background-c=
olor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-styl=
e: none; border-bottom-width: 0px; border-image-outset: 0; border-image-rep=
eat: stretch; border-image-slice: 100%; border-image-source: none; border-i=
mage-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none;=
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-=
style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bo=
rder-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-s=
ize: 13px; font-style: normal; font-variant: normal; font-weight: 400; lett=
er-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px=
; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; =
text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whi=
te-space: normal; word-spacing: 0px;"><font face=3D"courier new" style=3D"b=
order-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bott=
om-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border=
-image-slice: 100%; border-image-source: none; border-image-width: 1; borde=
r-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: =
0px; border-right-color: rgb(34, 34, 34); border-right-style: none; border-=
right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none=
; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right=
: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-rig=
ht: 0px; padding-top: 0px;"><span style=3D"background-color: transparent; b=
order-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bott=
om-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border=
-image-slice: 100%; border-image-source: none; border-image-width: 1; borde=
r-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: =
0px; border-right-color: rgb(34, 34, 34); border-right-style: none; border-=
right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none=
; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: no=
ne; font-family: courier new; font-size: 13px; font-style: normal; font-var=
iant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px;=
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-=
bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-=
align: left; text-decoration: none; text-indent: 0px; text-transform: none;=
-webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><=
span style=3D"background-color: transparent; border-bottom-color: rgb(34, 3=
4, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-o=
utset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-im=
age-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34)=
; border-left-style: none; border-left-width: 0px; border-right-color: rgb(=
34, 34, 34); border-right-style: none; border-right-width: 0px; border-top-=
color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; colo=
r: rgb(34, 34, 34); display: inline; float: none; font-family: courier new;=
font-size: 13px; font-style: normal; font-variant: normal; font-weight: 40=
0; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-rig=
ht: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;">=C2=A0 =C2=A0 </span></span>v =
=3D str;</font></div><div style=3D"background-color: transparent; border-bo=
ttom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width=
: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image-s=
lice: 100%; border-image-source: none; border-image-width: 1; border-left-c=
olor: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; bor=
der-right-color: rgb(34, 34, 34); border-right-style: none; border-right-wi=
dth: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border=
-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-style: norma=
l; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: =
2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top:=
0px; text-align: left; text-decoration: none; text-indent: 0px; text-trans=
form: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spaci=
ng: 0px;"><span style=3D"background-color: transparent; border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13p=
x; font-style: normal; font-variant: normal; font-weight: 400; letter-spaci=
ng: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin=
-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-righ=
t: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-ind=
ent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space=
: normal; word-spacing: 0px;"><span style=3D"background-color: transparent;=
border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bo=
ttom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; bord=
er-image-slice: 100%; border-image-source: none; border-image-width: 1; bor=
der-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width=
: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; borde=
r-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: no=
ne; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: =
none; font-size: 13px; font-style: normal; font-variant: normal; font-weigh=
t: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decora=
tion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"courier new=
,monospace" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px;">=C2=A0}</font></span></sp=
an></div><div style=3D"background-color: transparent; border-bottom-color: =
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; borde=
r-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; =
border-image-source: none; border-image-width: 1; border-left-color: rgb(34=
, 34, 34); border-left-style: none; border-left-width: 0px; border-right-co=
lor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; bo=
rder-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: =
0px; color: rgb(34, 34, 34); font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; =
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-a=
lign: left; text-decoration: none; text-indent: 0px; text-transform: none; =
-webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><s=
pan style=3D"background-color: transparent; border-bottom-color: rgb(34, 34=
, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-ou=
tset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-ima=
ge-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34);=
border-left-style: none; border-left-width: 0px; border-right-color: rgb(3=
4, 34, 34); border-right-style: none; border-right-width: 0px; border-top-c=
olor: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color=
: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-styl=
e: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; =
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; o=
rphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; te=
xt-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; wo=
rd-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"border-bott=
om-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: =
0px; border-image-outset: 0; border-image-repeat: stretch; border-image-sli=
ce: 100%; border-image-source: none; border-image-width: 1; border-left-col=
or: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; borde=
r-right-color: rgb(34, 34, 34); border-right-style: none; border-right-widt=
h: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-t=
op-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; mar=
gin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; p=
adding-top: 0px;">}</font></span></div><div style=3D"background-color: tran=
sparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; b=
order-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stret=
ch; border-image-slice: 100%; border-image-source: none; border-image-width=
: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-le=
ft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: non=
e; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-s=
tyle: none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px;=
font-style: normal; font-variant: normal; font-weight: 400; letter-spacing=
: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-t=
op: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right:=
0px; padding-top: 0px; text-align: left; text-decoration: none; text-inden=
t: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: =
normal; word-spacing: 0px;"><br style=3D"border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></div=
><div style=3D"background-color: transparent; border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; col=
or: rgb(34, 34, 34); font-size: 13px; font-style: normal; font-variant: nor=
mal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0=
px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: le=
ft; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-=
text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">int main()=
</div><div style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); font-size: 13px; font-style: normal; font-variant=
: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; mar=
gin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-alig=
n: left; text-decoration: none; text-indent: 0px; text-transform: none; -we=
bkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">{</di=
v><div style=3D"background-color: transparent; border-bottom-color: rgb(34,=
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image=
-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-=
image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 3=
4); border-left-style: none; border-left-width: 0px; border-right-color: rg=
b(34, 34, 34); border-right-style: none; border-right-width: 0px; border-to=
p-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; co=
lor: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing=
: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-t=
op: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right:=
0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform:=
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0=
px;"><div style=3D"background-color: transparent; border-bottom-color: rgb(=
34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-im=
age-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bord=
er-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34=
, 34); border-left-style: none; border-left-width: 0px; border-right-color:=
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border=
-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px;=
color: rgb(34, 34, 34); font-size: 13px; font-style: normal; font-variant:=
normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; marg=
in-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-botto=
m: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align=
: left; text-decoration: none; text-indent: 0px; text-transform: none; -web=
kit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span =
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34=
); border-bottom-style: none; border-bottom-width: 0px; border-image-outset=
: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-s=
ource: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bor=
der-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 3=
4, 34); border-right-style: none; border-right-width: 0px; border-top-color=
: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rg=
b(34, 34, 34); display: inline; float: none; font-size: 13px; font-style: n=
ormal; font-variant: normal; font-weight: 400; letter-spacing: normal; marg=
in-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orpha=
ns: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-=
top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-t=
ransform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-s=
pacing: 0px;"><span style=3D"background-color: transparent; border-bottom-c=
olor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px;=
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: =
100%; border-image-source: none; border-image-width: 1; border-left-color: =
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-ri=
ght-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0=
px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-w=
idth: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-famil=
y: courier new,monospace; font-size: 13px; font-style: normal; font-variant=
: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; mar=
gin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-alig=
n: left; text-decoration: none; text-indent: 0px; text-transform: none; -we=
bkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><font=
face=3D"courier new,monospace" style=3D"border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span=
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: r=
gb(34, 34, 34); display: inline; float: none; font-family: courier new,mono=
space; font-size: 13px; font-style: normal; font-variant: normal; font-weig=
ht: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; marg=
in-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-le=
ft: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decor=
ation: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wi=
dth: 0px; white-space: normal; word-spacing: 0px;">=C2=A0string_view& v=
;</span></font></span></span></div><div style=3D"background-color: transpar=
ent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; borde=
r-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; =
border-image-slice: 100%; border-image-source: none; border-image-width: 1;=
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-w=
idth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; b=
order-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style=
: none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; fon=
t-style: normal; font-variant: normal; font-weight: 400; letter-spacing: no=
rmal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: =
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px=
; padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0=
px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: norm=
al; word-spacing: 0px;"><span style=3D"background-color: transparent; borde=
r-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-w=
idth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-ima=
ge-slice: 100%; border-image-source: none; border-image-width: 1; border-le=
ft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px;=
border-right-color: rgb(34, 34, 34); border-right-style: none; border-righ=
t-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bo=
rder-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; =
font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400=
; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-righ=
t: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px=
; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration: =
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0p=
x; white-space: normal; word-spacing: 0px;"><span style=3D"background-color=
: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: n=
one; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat:=
stretch; border-image-slice: 100%; border-image-source: none; border-image=
-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bor=
der-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-styl=
e: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border=
-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: i=
nline; float: none; font-family: courier new,monospace; font-size: 13px; fo=
nt-style: normal; font-variant: normal; font-weight: 400; letter-spacing: n=
ormal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px; text-align: left; text-decoration: none; text-indent: =
0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: nor=
mal; word-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"bord=
er-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-=
width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-im=
age-slice: 100%; border-image-source: none; border-image-width: 1; border-l=
eft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px=
; border-right-color: rgb(34, 34, 34); border-right-style: none; border-rig=
ht-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; b=
order-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0=
px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right:=
0px; padding-top: 0px;"><span style=3D"background-color: transparent; bord=
er-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-=
width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-im=
age-slice: 100%; border-image-source: none; border-image-width: 1; border-l=
eft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px=
; border-right-color: rgb(34, 34, 34); border-right-style: none; border-rig=
ht-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; b=
order-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none;=
font-family: courier new,monospace; font-size: 13px; font-style: normal; f=
ont-variant: normal; font-weight: 400; letter-spacing: normal; margin-botto=
m: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; p=
adding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px=
; text-align: left; text-decoration: none; text-indent: 0px; text-transform=
: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: =
0px;">=C2=A0f(v);</span></font></span></span></div><div style=3D"background=
-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font=
-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; le=
tter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0=
px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pa=
dding-right: 0px; padding-top: 0px; text-align: left; text-decoration: none=
; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; w=
hite-space: normal; word-spacing: 0px;"><span style=3D"background-color: tr=
ansparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none;=
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: str=
etch; border-image-slice: 100%; border-image-source: none; border-image-wid=
th: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-=
left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: n=
one; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top=
-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inlin=
e; float: none; font-size: 13px; font-style: normal; font-variant: normal; =
font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; p=
adding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; t=
ext-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-=
stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"=
background-color: transparent; border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34,=
34); display: inline; float: none; font-family: courier new,monospace; fon=
t-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; l=
etter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: =
0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; p=
adding-right: 0px; padding-top: 0px; text-align: left; text-decoration: non=
e; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; =
white-space: normal; word-spacing: 0px;"><font face=3D"courier new,monospac=
e" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none=
; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: st=
retch; border-image-slice: 100%; border-image-source: none; border-image-wi=
dth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border=
-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: =
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-to=
p-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px;=
margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px=
; padding-right: 0px; padding-top: 0px;"><span style=3D"background-color: t=
ransparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none=
; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: st=
retch; border-image-slice: 100%; border-image-source: none; border-image-wi=
dth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border=
-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: =
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-to=
p-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inli=
ne; float: none; font-family: courier new,monospace; font-size: 13px; font-=
style: normal; font-variant: normal; font-weight: 400; letter-spacing: norm=
al; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0p=
x; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; =
padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px=
; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal=
; word-spacing: 0px;"><br></span></font></span></span></div><div style=3D"b=
ackground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-=
bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; borde=
r-image-repeat: stretch; border-image-slice: 100%; border-image-source: non=
e; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-s=
tyle: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bo=
rder-right-style: none; border-right-width: 0px; border-top-color: rgb(34, =
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, =
34); font-size: 13px; font-style: normal; font-variant: normal; font-weight=
: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin=
-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left=
: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decorat=
ion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-widt=
h: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"background-=
color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-sty=
le: none; border-bottom-width: 0px; border-image-outset: 0; border-image-re=
peat: stretch; border-image-slice: 100%; border-image-source: none; border-=
image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none=
; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right=
-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); b=
order-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); displ=
ay: inline; float: none; font-size: 13px; font-style: normal; font-variant:=
normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; marg=
in-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-botto=
m: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align=
: left; text-decoration: none; text-indent: 0px; text-transform: none; -web=
kit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span =
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34=
); border-bottom-style: none; border-bottom-width: 0px; border-image-outset=
: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-s=
ource: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bor=
der-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 3=
4, 34); border-right-style: none; border-right-width: 0px; border-top-color=
: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rg=
b(34, 34, 34); display: inline; float: none; font-family: courier new,monos=
pace; font-size: 13px; font-style: normal; font-variant: normal; font-weigh=
t: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decora=
tion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"courier new=
,monospace" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px;"><span style=3D"background=
-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); disp=
lay: inline; float: none; font-family: courier new,monospace; font-size: 13=
px; font-style: normal; font-variant: normal; font-weight: 400; letter-spac=
ing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margi=
n-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-rig=
ht: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-in=
dent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-spac=
e: normal; word-spacing: 0px;">=C2=A0return 0;</span></font></span></span><=
/div><div style=3D"background-color: transparent; border-bottom-color: rgb(=
34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-im=
age-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bord=
er-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34=
, 34); border-left-style: none; border-left-width: 0px; border-right-color:=
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border=
-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px;=
color: rgb(34, 34, 34); font-size: 13px; font-style: normal; font-variant:=
normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; marg=
in-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-botto=
m: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align=
: left; text-decoration: none; text-indent: 0px; text-transform: none; -web=
kit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span =
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34=
); border-bottom-style: none; border-bottom-width: 0px; border-image-outset=
: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-s=
ource: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bor=
der-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 3=
4, 34); border-right-style: none; border-right-width: 0px; border-top-color=
: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rg=
b(34, 34, 34); display: inline; float: none; font-size: 13px; font-style: n=
ormal; font-variant: normal; font-weight: 400; letter-spacing: normal; marg=
in-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orpha=
ns: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-=
top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-t=
ransform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-s=
pacing: 0px;"><span style=3D"background-color: transparent; border-bottom-c=
olor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px;=
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: =
100%; border-image-source: none; border-image-width: 1; border-left-color: =
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-ri=
ght-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0=
px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-w=
idth: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-famil=
y: courier new,monospace; font-size: 13px; font-style: normal; font-variant=
: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; mar=
gin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-alig=
n: left; text-decoration: none; text-indent: 0px; text-transform: none; -we=
bkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><font=
face=3D"courier new,monospace" style=3D"border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span=
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: r=
gb(34, 34, 34); display: inline; float: none; font-family: courier new,mono=
space; font-size: 13px; font-style: normal; font-variant: normal; font-weig=
ht: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; marg=
in-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-le=
ft: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decor=
ation: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wi=
dth: 0px; white-space: normal; word-spacing: 0px;">}</span></font></span></=
span></div><b style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-=
style: none; border-bottom-width: 0px; border-image-outset: 0; border-image=
-repeat: stretch; border-image-slice: 100%; border-image-source: none; bord=
er-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: n=
one; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-ri=
ght-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34)=
; border-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin=
-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; paddin=
g-left: 0px; padding-right: 0px; padding-top: 0px;"></b></div><div style=3D=
"background-color: transparent; border-bottom-color: rgb(34, 34, 34); borde=
r-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bor=
der-image-repeat: stretch; border-image-slice: 100%; border-image-source: n=
one; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left=
-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); =
border-right-style: none; border-right-width: 0px; border-top-color: rgb(34=
, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34=
, 34); font-size: 13px; font-style: normal; font-variant: normal; font-weig=
ht: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; marg=
in-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-le=
ft: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decor=
ation: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wi=
dth: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"backgroun=
d-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-s=
tyle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-=
repeat: stretch; border-image-slice: 100%; border-image-source: none; borde=
r-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: no=
ne; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-rig=
ht-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34);=
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); dis=
play: inline; float: none; font-size: 13px; font-style: normal; font-varian=
t: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; ma=
rgin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bot=
tom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-ali=
gn: left; text-decoration: none; text-indent: 0px; text-transform: none; -w=
ebkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><fon=
t face=3D"courier new" style=3D"border-bottom-color: rgb(34, 34, 34); borde=
r-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bor=
der-image-repeat: stretch; border-image-slice: 100%; border-image-source: n=
one; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left=
-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); =
border-right-style: none; border-right-width: 0px; border-top-color: rgb(34=
, 34, 34); border-top-style: none; border-top-width: 0px; margin-bottom: 0p=
x; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0p=
x; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b style=3D"bo=
rder-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-botto=
m-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-=
image-slice: 100%; border-image-source: none; border-image-width: 1; border=
-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0=
px; border-right-color: rgb(34, 34, 34); border-right-style: none; border-r=
ight-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none;=
border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right:=
0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-righ=
t: 0px; padding-top: 0px;"><br style=3D"border-bottom-color: rgb(34, 34, 34=
); border-bottom-style: none; border-bottom-width: 0px; border-image-outset=
: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-s=
ource: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bor=
der-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 3=
4, 34); border-right-style: none; border-right-width: 0px; border-top-color=
: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-bo=
ttom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bo=
ttom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></b></=
font></span></div><div style=3D"background-color: transparent; border-botto=
m-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0=
px; border-image-outset: 0; border-image-repeat: stretch; border-image-slic=
e: 100%; border-image-source: none; border-image-width: 1; border-left-colo=
r: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border=
-right-color: rgb(34, 34, 34); border-right-style: none; border-right-width=
: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-to=
p-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-style: normal; =
font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bott=
om: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; =
padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0p=
x; text-align: left; text-decoration: none; text-indent: 0px; text-transfor=
m: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing:=
0px;"><font face=3D"arial,sans-serif" style=3D"border-bottom-color: rgb(34=
, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-imag=
e-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border=
-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, =
34); border-left-style: none; border-left-width: 0px; border-right-color: r=
gb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-t=
op-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; m=
argin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; pa=
dding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;=
">The compiler still knows all that is needed, doesn't it? As long as t=
he view is an automatic variable the compiler can always detected if, durin=
g its lifetime, it is used after the pointed-to dtor is called.</font></div=
><div style=3D"background-color: transparent; border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; col=
or: rgb(34, 34, 34); font-size: 13px; font-style: normal; font-variant: nor=
mal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0=
px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: le=
ft; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-=
text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><br></div>=
<div style=3D"background-color: transparent; border-bottom-color: rgb(34, 3=
4, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-o=
utset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-im=
age-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34)=
; border-left-style: none; border-left-width: 0px; border-right-color: rgb(=
34, 34, 34); border-right-style: none; border-right-width: 0px; border-top-=
color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; colo=
r: rgb(34, 34, 34); font-size: 13px; font-style: normal; font-variant: norm=
al; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-le=
ft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0p=
x; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: lef=
t; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-t=
ext-stroke-width: 0px; white-space: normal; word-spacing: 0px;">Isn't t=
hat <i style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: =
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat=
: stretch; border-image-slice: 100%; border-image-source: none; border-imag=
e-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bo=
rder-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-sty=
le: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); borde=
r-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left:=
0px; padding-right: 0px; padding-top: 0px;">always</i> the case? Isn't=
that that case <i style=3D"border-bottom-color: rgb(34, 34, 34); border-bo=
ttom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-=
image-repeat: stretch; border-image-slice: 100%; border-image-source: none;=
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-sty=
le: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bord=
er-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34=
, 34); border-top-style: none; border-top-width: 0px; margin-bottom: 0px; m=
argin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; p=
adding-left: 0px; padding-right: 0px; padding-top: 0px;">even if</i> the=C2=
=A0<span style=3D"background-color: transparent; border-bottom-color: rgb(3=
4, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-ima=
ge-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; borde=
r-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34,=
34); border-left-style: none; border-left-width: 0px; border-right-color: =
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-=
top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; =
color: rgb(34, 34, 34); display: inline; float: none; font-family: arial,sa=
ns-serif; font-size: 13px; font-style: normal; font-variant: normal; font-w=
eight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; m=
argin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding=
-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-de=
coration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke=
-width: 0px; white-space: normal; word-spacing: 0px;">pointed-to is heap al=
located?=C2=A0</span></div><div style=3D"background-color: transparent; bor=
der-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom=
-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-i=
mage-slice: 100%; border-image-source: none; border-image-width: 1; border-=
left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0p=
x; border-right-color: rgb(34, 34, 34); border-right-style: none; border-ri=
ght-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; =
border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-style:=
normal; font-variant: normal; font-weight: 400; letter-spacing: normal; ma=
rgin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orp=
hans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; paddin=
g-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text=
-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word=
-spacing: 0px;"><span style=3D"background-color: transparent; border-bottom=
-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0p=
x; border-image-outset: 0; border-image-repeat: stretch; border-image-slice=
: 100%; border-image-source: none; border-image-width: 1; border-left-color=
: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-=
right-color: rgb(34, 34, 34); border-right-style: none; border-right-width:=
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top=
-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-fam=
ily: arial,sans-serif; font-size: 13px; font-style: normal; font-variant: n=
ormal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin=
-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom:=
0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: =
left; text-decoration: none; text-indent: 0px; text-transform: none; -webki=
t-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><br styl=
e=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; borde=
r-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; =
border-image-slice: 100%; border-image-source: none; border-image-width: 1;=
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-w=
idth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; b=
order-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style=
: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin=
-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; paddi=
ng-right: 0px; padding-top: 0px;"></span></div><div style=3D"background-col=
or: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style:=
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repea=
t: stretch; border-image-slice: 100%; border-image-source: none; border-ima=
ge-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; b=
order-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-st=
yle: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bord=
er-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-siz=
e: 13px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px; =
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-a=
lign: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"background=
-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); disp=
lay: inline; float: none; font-family: arial,sans-serif; font-size: 13px; f=
ont-variant: normal; letter-spacing: normal; margin-bottom: 0px; margin-lef=
t: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px=
; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left=
; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; w=
hite-space: normal; word-spacing: 0px;"><span style=3D"background-color: tr=
ansparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none;=
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: str=
etch; border-image-slice: 100%; border-image-source: none; border-image-wid=
th: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-=
left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: n=
one; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top=
-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inlin=
e; float: none; font-family: courier new,monospace; font-size: 13px; font-s=
tyle: normal; font-variant: normal; font-weight: 400; letter-spacing: norma=
l; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px=
; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; p=
adding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px;=
text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal;=
word-spacing: 0px;">o_view v =3D o_p->getView();</span></span></div><di=
v style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, =
34); border-bottom-style: none; border-bottom-width: 0px; border-image-outs=
et: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image=
-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); b=
order-left-style: none; border-left-width: 0px; border-right-color: rgb(34,=
34, 34); border-right-style: none; border-right-width: 0px; border-top-col=
or: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: =
rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing: nor=
mal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0=
px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;=
padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none=
; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=
<span style=3D"background-color: transparent; border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; col=
or: rgb(34, 34, 34); display: inline; float: none; font-family: arial,sans-=
serif; font-size: 13px; font-variant: normal; letter-spacing: normal; margi=
n-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphan=
s: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-t=
op: 0px; text-align: left; text-indent: 0px; text-transform: none; -webkit-=
text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span styl=
e=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); b=
order-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0;=
border-image-repeat: stretch; border-image-slice: 100%; border-image-sourc=
e: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-=
left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 3=
4); border-right-style: none; border-right-width: 0px; border-top-color: rg=
b(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34=
, 34, 34); display: inline; float: none; font-family: courier new,monospace=
; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 4=
00; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-ri=
ght: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0=
px; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration=
: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: =
0px; white-space: normal; word-spacing: 0px;"><br style=3D"border-bottom-co=
lor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; =
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 1=
00%; border-image-source: none; border-image-width: 1; border-left-color: r=
gb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-rig=
ht-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0p=
x; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wi=
dth: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-t=
op: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; paddin=
g-top: 0px;"></span></span></div><div style=3D"background-color: transparen=
t; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-=
bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; bo=
rder-image-slice: 100%; border-image-source: none; border-image-width: 1; b=
order-left-color: rgb(34, 34, 34); border-left-style: none; border-left-wid=
th: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; bor=
der-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: =
none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-=
variant: normal; letter-spacing: normal; margin-bottom: 0px; margin-left: 0=
px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; pa=
dding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; te=
xt-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white=
-space: normal; word-spacing: 0px;"><span style=3D"background-color: transp=
arent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bor=
der-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch=
; border-image-slice: 100%; border-image-source: none; border-image-width: =
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left=
-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none;=
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-sty=
le: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; f=
loat: none; font-size: 13px; font-variant: normal; letter-spacing: normal; =
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; o=
rphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px; text-align: left; text-indent: 0px; text-transform: none; -we=
bkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span=
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: r=
gb(34, 34, 34); display: inline; float: none; font-size: 13px; font-variant=
: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; mar=
gin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-alig=
n: left; text-decoration: none; text-indent: 0px; text-transform: none; -we=
bkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><font=
face=3D"arial,sans-serif" style=3D"border-bottom-color: rgb(34, 34, 34); b=
order-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0;=
border-image-repeat: stretch; border-image-slice: 100%; border-image-sourc=
e: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-=
left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 3=
4); border-right-style: none; border-right-width: 0px; border-top-color: rg=
b(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-bottom=
: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom=
: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">The compil=
er can <i style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-styl=
e: none; border-bottom-width: 0px; border-image-outset: 0; border-image-rep=
eat: stretch; border-image-slice: 100%; border-image-source: none; border-i=
mage-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none;=
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-=
style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bo=
rder-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-lef=
t: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-le=
ft: 0px; padding-right: 0px; padding-top: 0px;">still</i> tell if *<span st=
yle=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34);=
border-bottom-style: none; border-bottom-width: 0px; border-image-outset: =
0; border-image-repeat: stretch; border-image-slice: 100%; border-image-sou=
rce: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); borde=
r-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34,=
34); border-right-style: none; border-right-width: 0px; border-top-color: =
rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(=
34, 34, 34); display: inline; float: none; font-size: 13px; font-variant: n=
ormal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin=
-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom:=
0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: =
left; text-decoration: none; text-indent: 0px; text-transform: none; -webki=
t-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">o_p is d=
estroyed before v is destroyed. Am I mistaken here?=C2=A0</span></font></sp=
an></span></div><div style=3D"background-color: transparent; border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
100%; border-image-source: none; border-image-width: 1; border-left-color:=
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; =
letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right:=
0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; =
padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; t=
ext-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; w=
ord-spacing: 0px;"><span style=3D"background-color: transparent; border-bot=
tom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width:=
0px; border-image-outset: 0; border-image-repeat: stretch; border-image-sl=
ice: 100%; border-image-source: none; border-image-width: 1; border-left-co=
lor: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; bord=
er-right-color: rgb(34, 34, 34); border-right-style: none; border-right-wid=
th: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-=
top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-=
size: 13px; font-variant: normal; letter-spacing: normal; margin-bottom: 0p=
x; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; paddin=
g-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; tex=
t-align: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-=
width: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"backgro=
und-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom=
-style: none; border-bottom-width: 0px; border-image-outset: 0; border-imag=
e-repeat: stretch; border-image-slice: 100%; border-image-source: none; bor=
der-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: =
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-r=
ight-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34=
); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); d=
isplay: inline; float: none; font-size: 13px; font-variant: normal; font-we=
ight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-dec=
oration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-=
width: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"arial,sa=
ns-serif" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-styl=
e: none; border-bottom-width: 0px; border-image-outset: 0; border-image-rep=
eat: stretch; border-image-slice: 100%; border-image-source: none; border-i=
mage-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none;=
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-=
style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bo=
rder-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-lef=
t: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-le=
ft: 0px; padding-right: 0px; padding-top: 0px;"><span style=3D"background-c=
olor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-styl=
e: none; border-bottom-width: 0px; border-image-outset: 0; border-image-rep=
eat: stretch; border-image-slice: 100%; border-image-source: none; border-i=
mage-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none;=
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-=
style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bo=
rder-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); displa=
y: inline; float: none; font-size: 13px; font-variant: normal; font-weight:=
400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-=
right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left:=
0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decorati=
on: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width=
: 0px; white-space: normal; word-spacing: 0px;"><br style=3D"border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
100%; border-image-source: none; border-image-width: 1; border-left-color:=
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin=
-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px;"></span></font></span></span></div><div style=3D"background-c=
olor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-styl=
e: none; border-bottom-width: 0px; border-image-outset: 0; border-image-rep=
eat: stretch; border-image-slice: 100%; border-image-source: none; border-i=
mage-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none;=
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-=
style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bo=
rder-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-s=
ize: 13px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px=
; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding=
-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text=
-align: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-w=
idth: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"backgrou=
nd-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-=
style: none; border-bottom-width: 0px; border-image-outset: 0; border-image=
-repeat: stretch; border-image-slice: 100%; border-image-source: none; bord=
er-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: n=
one; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-ri=
ght-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34)=
; border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); di=
splay: inline; float: none; font-size: 13px; font-variant: normal; letter-s=
pacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; ma=
rgin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-=
right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-tran=
sform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spac=
ing: 0px;"><span style=3D"background-color: transparent; border-bottom-colo=
r: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bo=
rder-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100=
%; border-image-source: none; border-image-width: 1; border-left-color: rgb=
(34, 34, 34); border-left-style: none; border-left-width: 0px; border-right=
-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px;=
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-widt=
h: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13=
px; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-=
bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans:=
2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top=
: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-tran=
sform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spac=
ing: 0px;"><font face=3D"arial,sans-serif" style=3D"border-bottom-color: rg=
b(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-=
image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bo=
rder-image-source: none; border-image-width: 1; border-left-color: rgb(34, =
34, 34); border-left-style: none; border-left-width: 0px; border-right-colo=
r: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; bord=
er-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0p=
x; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px=
; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: =
0px;"><span style=3D"background-color: transparent; border-bottom-color: rg=
b(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-=
image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bo=
rder-image-source: none; border-image-width: 1; border-left-color: rgb(34, =
34, 34); border-left-style: none; border-left-width: 0px; border-right-colo=
r: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; bord=
er-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0p=
x; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; f=
ont-variant: normal; font-weight: 400; letter-spacing: normal; margin-botto=
m: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; p=
adding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px=
; text-align: left; text-decoration: none; text-indent: 0px; text-transform=
: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: =
0px;">Considering view classes are 99.9% of the time used as automatic vari=
ables, there is no good reason for them to be unsafe. </span></font></span>=
</span></div><div style=3D"background-color: transparent; border-bottom-col=
or: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; b=
order-image-outset: 0; border-image-repeat: stretch; border-image-slice: 10=
0%; border-image-source: none; border-image-width: 1; border-left-color: rg=
b(34, 34, 34); border-left-style: none; border-left-width: 0px; border-righ=
t-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px=
; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wid=
th: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; let=
ter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0p=
x; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pad=
ding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text=
-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word=
-spacing: 0px;"><span style=3D"background-color: transparent; border-bottom=
-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0p=
x; border-image-outset: 0; border-image-repeat: stretch; border-image-slice=
: 100%; border-image-source: none; border-image-width: 1; border-left-color=
: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-=
right-color: rgb(34, 34, 34); border-right-style: none; border-right-width:=
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top=
-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-siz=
e: 13px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px; =
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-a=
lign: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"background=
-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-st=
yle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-r=
epeat: stretch; border-image-slice: 100%; border-image-source: none; border=
-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: non=
e; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-righ=
t-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); =
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); disp=
lay: inline; float: none; font-size: 13px; font-variant: normal; font-weigh=
t: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decora=
tion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"arial,sans-=
serif" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: =
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat=
: stretch; border-image-slice: 100%; border-image-source: none; border-imag=
e-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bo=
rder-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-sty=
le: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); borde=
r-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left:=
0px; padding-right: 0px; padding-top: 0px;"><span style=3D"background-colo=
r: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: =
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat=
: stretch; border-image-slice: 100%; border-image-source: none; border-imag=
e-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bo=
rder-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-sty=
le: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); borde=
r-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: =
inline; float: none; font-size: 13px; font-variant: normal; font-weight: 40=
0; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-rig=
ht: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;"><br></span></font></span></spa=
n></div><div style=3D"background-color: transparent; border-bottom-color: r=
gb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border=
-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; b=
order-image-source: none; border-image-width: 1; border-left-color: rgb(34,=
34, 34); border-left-style: none; border-left-width: 0px; border-right-col=
or: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; bor=
der-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0=
px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-s=
pacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; ma=
rgin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-=
right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-tran=
sform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spac=
ing: 0px;"><span style=3D"background-color: transparent; border-bottom-colo=
r: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bo=
rder-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100=
%; border-image-source: none; border-image-width: 1; border-left-color: rgb=
(34, 34, 34); border-left-style: none; border-left-width: 0px; border-right=
-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px;=
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-widt=
h: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13=
px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px; margi=
n-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom=
: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align:=
left; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;"><span style=3D"background-colo=
r: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: =
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat=
: stretch; border-image-slice: 100%; border-image-source: none; border-imag=
e-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bo=
rder-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-sty=
le: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); borde=
r-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: =
inline; float: none; font-size: 13px; font-variant: normal; font-weight: 40=
0; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-rig=
ht: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;"><font face=3D"arial,sans-serif=
" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none;=
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: str=
etch; border-image-slice: 100%; border-image-source: none; border-image-wid=
th: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-=
left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: n=
one; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top=
-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; =
margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px;=
padding-right: 0px; padding-top: 0px;"><span style=3D"background-color: tr=
ansparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none;=
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: str=
etch; border-image-slice: 100%; border-image-source: none; border-image-wid=
th: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-=
left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: n=
one; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top=
-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inlin=
e; float: none; font-size: 13px; font-variant: normal; font-weight: 400; le=
tter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0=
px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pa=
dding-right: 0px; padding-top: 0px; text-align: left; text-decoration: none=
; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; w=
hite-space: normal; word-spacing: 0px;">(Or maybe there is, I might be miss=
ing something)</span></font></span></span></div><div style=3D"background-co=
lor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style=
: none; border-bottom-width: 0px; border-image-outset: 0; border-image-repe=
at: stretch; border-image-slice: 100%; border-image-source: none; border-im=
age-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; =
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-s=
tyle: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bor=
der-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-si=
ze: 13px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px;=
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-=
bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-=
align: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-wi=
dth: 0px; white-space: normal; word-spacing: 0px;"><span style=3D"backgroun=
d-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-s=
tyle: none; border-bottom-width: 0px; border-image-outset: 0; border-image-=
repeat: stretch; border-image-slice: 100%; border-image-source: none; borde=
r-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: no=
ne; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-rig=
ht-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34);=
border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); dis=
play: inline; float: none; font-size: 13px; font-variant: normal; letter-sp=
acing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; mar=
gin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-r=
ight: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-trans=
form: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spaci=
ng: 0px;"><span style=3D"background-color: transparent; border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13p=
x; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-b=
ottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: =
2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top:=
0px; text-align: left; text-decoration: none; text-indent: 0px; text-trans=
form: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spaci=
ng: 0px;"><font face=3D"arial,sans-serif" style=3D"border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;=
padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0=
px;"><span style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; fo=
nt-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom=
: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; pa=
dding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;=
text-align: left; text-decoration: none; text-indent: 0px; text-transform:=
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0=
px;"><br></span></font></span></span></div><div style=3D"background-color: =
transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: non=
e; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: s=
tretch; border-image-slice: 100%; border-image-source: none; border-image-w=
idth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; borde=
r-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style:=
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-t=
op-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: 1=
3px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px; marg=
in-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-botto=
m: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align=
: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: =
0px; white-space: normal; word-spacing: 0px;"><span style=3D"background-col=
or: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style:=
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repea=
t: stretch; border-image-slice: 100%; border-image-source: none; border-ima=
ge-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; b=
order-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-st=
yle: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bord=
er-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display:=
inline; float: none; font-size: 13px; font-variant: normal; letter-spacing=
: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-t=
op: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right:=
0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform:=
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0=
px;"><span style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; fo=
nt-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom=
: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; pa=
dding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;=
text-align: left; text-decoration: none; text-indent: 0px; text-transform:=
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0=
px;"><font face=3D"arial,sans-serif" style=3D"border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; mar=
gin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padd=
ing-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">=
<span style=3D"background-color: transparent; border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; col=
or: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-va=
riant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px=
; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding=
-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text=
-align: left; text-decoration: none; text-indent: 0px; text-transform: none=
; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=
<br></span></font></span></span></div><div style=3D"background-color: trans=
parent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bo=
rder-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretc=
h; border-image-slice: 100%; border-image-source: none; border-image-width:=
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-lef=
t-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none=
; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-st=
yle: none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; =
font-variant: normal; letter-spacing: normal; margin-bottom: 0px; margin-le=
ft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0p=
x; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: lef=
t; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; =
white-space: normal; word-spacing: 0px;">And lets talk copies.</div><div st=
yle=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34);=
border-bottom-style: none; border-bottom-width: 0px; border-image-outset: =
0; border-image-repeat: stretch; border-image-slice: 100%; border-image-sou=
rce: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); borde=
r-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34,=
34); border-right-style: none; border-right-width: 0px; border-top-color: =
rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(=
34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing: normal;=
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; =
orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; pad=
ding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; -w=
ebkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><br>=
</div><div style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-spa=
cing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; marg=
in-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-ri=
ght: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transf=
orm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacin=
g: 0px;"> Nothing is actually preventing this tracking to work for copies o=
f the view as well - the rules are exactly the same - if before view.~view(=
) there is a call to object.~object() there should be no view,access(). </d=
iv><div style=3D"background-color: transparent; border-bottom-color: rgb(34=
, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-imag=
e-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border=
-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, =
34); border-left-style: none; border-left-width: 0px; border-right-color: r=
gb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-t=
op-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; c=
olor: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-spacin=
g: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-=
top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right=
: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform=
: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: =
0px;"><br></div><div style=3D"background-color: transparent; border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
100%; border-image-source: none; border-image-width: 1; border-left-color:=
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; =
letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right:=
0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; =
padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; t=
ext-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; w=
ord-spacing: 0px;">How many views are, it does not matter at all as long as=
they are automatic. </div><div style=3D"background-color: transparent; bor=
der-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom=
-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-i=
mage-slice: 100%; border-image-source: none; border-image-width: 1; border-=
left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0p=
x; border-right-color: rgb(34, 34, 34); border-right-style: none; border-ri=
ght-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; =
border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-varian=
t: normal; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-ind=
ent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space=
: normal; word-spacing: 0px;"><br></div><div style=3D"background-color: tra=
nsparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; =
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stre=
tch; border-image-slice: 100%; border-image-source: none; border-image-widt=
h: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-l=
eft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: no=
ne; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-=
style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px=
; font-variant: normal; letter-spacing: normal; margin-bottom: 0px; margin-=
left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: =
0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: l=
eft; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px=
; white-space: normal; word-spacing: 0px;">It also does not matter if ~obje=
ct() was called by the compiler (automatic), the user (delete p_object;) or=
by a ref counted shared_ptr!</div><div style=3D"background-color: transpar=
ent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; borde=
r-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; =
border-image-slice: 100%; border-image-source: none; border-image-width: 1;=
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-w=
idth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; b=
order-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style=
: none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; fon=
t-variant: normal; letter-spacing: normal; margin-bottom: 0px; margin-left:=
0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; =
padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; =
text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whi=
te-space: normal; word-spacing: 0px;"><br></div><div style=3D"background-co=
lor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style=
: none; border-bottom-width: 0px; border-image-outset: 0; border-image-repe=
at: stretch; border-image-slice: 100%; border-image-source: none; border-im=
age-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; =
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-s=
tyle: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bor=
der-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-si=
ze: 13px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px;=
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-=
bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-=
align: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-wi=
dth: 0px; white-space: normal; word-spacing: 0px;"><br></div><div style=3D"=
background-color: transparent; border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34,=
34); font-size: 13px; font-variant: normal; letter-spacing: normal; margin=
-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans=
: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-to=
p: 0px; text-align: left; text-indent: 0px; text-transform: none; -webkit-t=
ext-stroke-width: 0px; white-space: normal; word-spacing: 0px;">With that i=
n mind.</div><div style=3D"background-color: transparent; border-bottom-col=
or: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; b=
order-image-outset: 0; border-image-repeat: stretch; border-image-slice: 10=
0%; border-image-source: none; border-image-width: 1; border-left-color: rg=
b(34, 34, 34); border-left-style: none; border-left-width: 0px; border-righ=
t-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px=
; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wid=
th: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; let=
ter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0p=
x; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pad=
ding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text=
-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word=
-spacing: 0px;"><br></div><div style=3D"background-color: transparent; bord=
er-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-=
width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-im=
age-slice: 100%; border-image-source: none; border-image-width: 1; border-l=
eft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px=
; border-right-color: rgb(34, 34, 34); border-right-style: none; border-rig=
ht-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; b=
order-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant=
: normal; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; mar=
gin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-l=
eft: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-inde=
nt: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space:=
normal; word-spacing: 0px;">void f(view<B> vb) //< by copy</div><=
div style=3D"background-color: transparent; border-bottom-color: rgb(34, 34=
, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-ou=
tset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-ima=
ge-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34);=
border-left-style: none; border-left-width: 0px; border-right-color: rgb(3=
4, 34, 34); border-right-style: none; border-right-width: 0px; border-top-c=
olor: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color=
: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing: n=
ormal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: no=
ne; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;=
">{</div><div style=3D"background-color: transparent; border-bottom-color: =
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; borde=
r-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; =
border-image-source: none; border-image-width: 1; border-left-color: rgb(34=
, 34, 34); border-left-style: none; border-left-width: 0px; border-right-co=
lor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; bo=
rder-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: =
0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-=
spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; m=
argin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding=
-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-tra=
nsform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spa=
cing: 0px;">=C2=A0=C2=A0 destroy_b_unknowingly();</div><div style=3D"backgr=
ound-color: transparent; border-bottom-color: rgb(34, 34, 34); border-botto=
m-style: none; border-bottom-width: 0px; border-image-outset: 0; border-ima=
ge-repeat: stretch; border-image-slice: 100%; border-image-source: none; bo=
rder-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style:=
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-=
right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 3=
4); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); =
font-size: 13px; font-variant: normal; letter-spacing: normal; margin-botto=
m: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; p=
adding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px=
; text-align: left; text-indent: 0px; text-transform: none; -webkit-text-st=
roke-width: 0px; white-space: normal; word-spacing: 0px;"><br></div><div st=
yle=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34);=
border-bottom-style: none; border-bottom-width: 0px; border-image-outset: =
0; border-image-repeat: stretch; border-image-slice: 100%; border-image-sou=
rce: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); borde=
r-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34,=
34); border-right-style: none; border-right-width: 0px; border-top-color: =
rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(=
34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing: normal;=
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; =
orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; pad=
ding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; -w=
ebkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=C2=
=A0 vb.use(); //< warning, dtor of b was called already</div><div style=
=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); font-size: 13px; font-variant: normal; letter-spacing: normal; ma=
rgin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orp=
hans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; paddin=
g-top: 0px; text-align: left; text-indent: 0px; text-transform: none; -webk=
it-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">}</div>=
<div style=3D"background-color: transparent; border-bottom-color: rgb(34, 3=
4, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-o=
utset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-im=
age-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34)=
; border-left-style: none; border-left-width: 0px; border-right-color: rgb(=
34, 34, 34); border-right-style: none; border-right-width: 0px; border-top-=
color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; colo=
r: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing: =
normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top=
: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0=
px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: n=
one; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px=
;"><br></div><div style=3D"background-color: transparent; border-bottom-col=
or: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; b=
order-image-outset: 0; border-image-repeat: stretch; border-image-slice: 10=
0%; border-image-source: none; border-image-width: 1; border-left-color: rg=
b(34, 34, 34); border-left-style: none; border-left-width: 0px; border-righ=
t-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px=
; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wid=
th: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; let=
ter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0p=
x; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pad=
ding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text=
-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word=
-spacing: 0px;"><br></div><div style=3D"background-color: transparent; bord=
er-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-=
width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-im=
age-slice: 100%; border-image-source: none; border-image-width: 1; border-l=
eft-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px=
; border-right-color: rgb(34, 34, 34); border-right-style: none; border-rig=
ht-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; b=
order-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant=
: normal; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; mar=
gin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-l=
eft: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-inde=
nt: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space:=
normal; word-spacing: 0px;"><br></div><div style=3D"background-color: tran=
sparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; b=
order-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stret=
ch; border-image-slice: 100%; border-image-source: none; border-image-width=
: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-le=
ft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: non=
e; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-s=
tyle: none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px;=
font-variant: normal; letter-spacing: normal; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0=
px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: le=
ft; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px;=
white-space: normal; word-spacing: 0px;">Even further investigation</div><=
div style=3D"background-color: transparent; border-bottom-color: rgb(34, 34=
, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-ou=
tset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-ima=
ge-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34);=
border-left-style: none; border-left-width: 0px; border-right-color: rgb(3=
4, 34, 34); border-right-style: none; border-right-width: 0px; border-top-c=
olor: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color=
: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing: n=
ormal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: no=
ne; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;=
"><br></div><div style=3D"background-color: transparent; border-bottom-colo=
r: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bo=
rder-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100=
%; border-image-source: none; border-image-width: 1; border-left-color: rgb=
(34, 34, 34); border-left-style: none; border-left-width: 0px; border-right=
-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px;=
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-widt=
h: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; lett=
er-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px=
; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-=
transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-=
spacing: 0px;">template<class T></div><div style=3D"background-color:=
transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: no=
ne; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: =
stretch; border-image-slice: 100%; border-image-source: none; border-image-=
width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bord=
er-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style=
: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-=
top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-size: =
13px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px; mar=
gin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-alig=
n: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-width:=
0px; white-space: normal; word-spacing: 0px;">class unique_ptr</div><div s=
tyle=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34)=
; border-bottom-style: none; border-bottom-width: 0px; border-image-outset:=
0; border-image-repeat: stretch; border-image-slice: 100%; border-image-so=
urce: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bord=
er-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34=
, 34); border-right-style: none; border-right-width: 0px; border-top-color:=
rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb=
(34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing: normal=
; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;=
orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; pa=
dding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; -=
webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">{</=
div><div style=3D"background-color: transparent; border-bottom-color: rgb(3=
4, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-ima=
ge-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; borde=
r-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34,=
34); border-left-style: none; border-left-width: 0px; border-right-color: =
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-=
top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; =
color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; letter-spaci=
ng: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin=
-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-righ=
t: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transfor=
m: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing:=
0px;">=C2=A0 ...</div><div style=3D"background-color: transparent; border-=
bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-wid=
th: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image=
-slice: 100%; border-image-source: none; border-image-width: 1; border-left=
-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; b=
order-right-color: rgb(34, 34, 34); border-right-style: none; border-right-=
width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bord=
er-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: n=
ormal; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin=
-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left=
: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent:=
0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: no=
rmal; word-spacing: 0px;">=C2=A0=C2=A0<span style=3D"background-color: tran=
sparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; b=
order-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stret=
ch; border-image-slice: 100%; border-image-source: none; border-image-width=
: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-le=
ft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: non=
e; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-s=
tyle: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inline;=
float: none; font-family: &quot;Arial&quot;,&quot;Helvetica&am=
p;quot;,sans-serif; font-size: 13px; font-style: normal; font-variant: norm=
al; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-le=
ft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0p=
x; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: lef=
t; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-t=
ext-stroke-width: 0px; white-space: normal; word-spacing: 0px;"> [[dependen=
t_lifetime]] </span>T* get() { return _p; }</div><div style=3D"background-c=
olor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-styl=
e: none; border-bottom-width: 0px; border-image-outset: 0; border-image-rep=
eat: stretch; border-image-slice: 100%; border-image-source: none; border-i=
mage-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none;=
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-=
style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bo=
rder-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-s=
ize: 13px; font-variant: normal; letter-spacing: normal; margin-bottom: 0px=
; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding=
-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text=
-align: left; text-indent: 0px; text-transform: none; -webkit-text-stroke-w=
idth: 0px; white-space: normal; word-spacing: 0px;">=C2=A0 ...</div><div st=
yle=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34);=
border-bottom-style: none; border-bottom-width: 0px; border-image-outset: =
0; border-image-repeat: stretch; border-image-slice: 100%; border-image-sou=
rce: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); borde=
r-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34,=
34); border-right-style: none; border-right-width: 0px; border-top-color: =
rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(=
34, 34, 34); font-size: 13px; font-variant: normal; letter-spacing: normal;=
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; =
orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; pad=
ding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; -w=
ebkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=C2=
=A0 T* _p;</div><div style=3D"background-color: transparent; border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
100%; border-image-source: none; border-image-width: 1; border-left-color:=
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-variant: normal; =
letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right:=
0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; =
padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; t=
ext-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; w=
ord-spacing: 0px;">};</div><div style=3D"background-color: transparent; bor=
der-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom=
-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-i=
mage-slice: 100%; border-image-source: none; border-image-width: 1; border-=
left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0p=
x; border-right-color: rgb(34, 34, 34); border-right-style: none; border-ri=
ght-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; =
border-top-width: 0px; color: rgb(34, 34, 34); font-size: 13px; font-varian=
t: normal; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-ind=
ent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space=
: normal; word-spacing: 0px;"><span style=3D"background-color: transparent;=
border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bo=
ttom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; bord=
er-image-slice: 100%; border-image-source: none; border-image-width: 1; bor=
der-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width=
: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; borde=
r-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: no=
ne; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: =
none; font-size: 13px; font-variant: normal; font-weight: 400; letter-spaci=
ng: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin=
-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-righ=
t: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-ind=
ent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space=
: normal; word-spacing: 0px;"><b style=3D"border-bottom-color: rgb(34, 34, =
34); border-bottom-style: none; border-bottom-width: 0px; border-image-outs=
et: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image=
-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); b=
order-left-style: none; border-left-width: 0px; border-right-color: rgb(34,=
34, 34); border-right-style: none; border-right-width: 0px; border-top-col=
or: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-=
bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-=
bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><u s=
tyle=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bo=
rder-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretc=
h; border-image-slice: 100%; border-image-source: none; border-image-width:=
1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-lef=
t-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none=
; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-st=
yle: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; mar=
gin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; pa=
dding-right: 0px; padding-top: 0px;"><sub style=3D"border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;=
padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0=
px;"><font face=3D"arial,sans-serif" style=3D"border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; mar=
gin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padd=
ing-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">=
<br style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: non=
e; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: s=
tretch; border-image-slice: 100%; border-image-source: none; border-image-w=
idth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; borde=
r-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style:=
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-t=
op-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px=
; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px;"></font></sub></u></b></span></div=
></span></div><div style=3D"background-color: transparent; border-bottom-co=
lor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; =
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 1=
00%; border-image-source: none; border-image-width: 1; border-left-color: r=
gb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-rig=
ht-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0p=
x; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wi=
dth: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&a=
mp;quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal=
; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bo=
ttom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2=
; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: =
0px; text-align: left; text-decoration: none; text-indent: 0px; text-transf=
orm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacin=
g: 0px;"><br></div><div style=3D"background-color: transparent; border-bott=
om-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: =
0px; border-image-outset: 0; border-image-repeat: stretch; border-image-sli=
ce: 100%; border-image-source: none; border-image-width: 1; border-left-col=
or: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; borde=
r-right-color: rgb(34, 34, 34); border-right-style: none; border-right-widt=
h: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-t=
op-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quo=
t;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: n=
ormal; font-variant: normal; font-weight: 400; letter-spacing: normal; marg=
in-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orpha=
ns: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-=
top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-t=
ransform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-s=
pacing: 0px;">Now the variable of type T* is a view to the unique_ptr. If ~=
unique_ptr() is called before the (automatic) T* variable, created/assigned=
by get, goes out of scope, it will be an error to use that variable.=C2=A0=
</div><div style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;=
Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal; font-v=
ariant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0p=
x; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; paddin=
g-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; tex=
t-align: left; text-decoration: none; text-indent: 0px; text-transform: non=
e; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"=
><br></div><div style=3D"background-color: transparent; border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&=
quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal; f=
ont-variant: normal; font-weight: 400; letter-spacing: normal; margin-botto=
m: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; p=
adding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px=
; text-align: left; text-decoration: none; text-indent: 0px; text-transform=
: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: =
0px;"><br></div><div style=3D"background-color: transparent; border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
100%; border-image-source: none; border-image-width: 1; border-left-color:=
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,=
&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: norm=
al; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-=
bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans:=
2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top=
: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-tran=
sform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spac=
ing: 0px;">But, lets take this to the next level:</div><div style=3D"backgr=
ound-color: transparent; border-bottom-color: rgb(34, 34, 34); border-botto=
m-style: none; border-bottom-width: 0px; border-image-outset: 0; border-ima=
ge-repeat: stretch; border-image-slice: 100%; border-image-source: none; bo=
rder-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style:=
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-=
right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 3=
4); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); =
font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-s=
erif; font-size: 13px; font-style: normal; font-variant: normal; font-weigh=
t: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decora=
tion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><br></div><div style=3D"m=
argin: 0px; padding: 0px; border: 0px rgb(34, 34, 34); border-image: none; =
text-align: left; color: rgb(34, 34, 34); text-transform: none; text-indent=
: 0px; letter-spacing: normal; font-size: 13px; font-variant: normal; word-=
spacing: 0px; white-space: normal; orphans: 2; -webkit-text-stroke-width: 0=
px; background-color: transparent;"><div style=3D"background-color: transpa=
rent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bord=
er-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch;=
border-image-slice: 100%; border-image-source: none; border-image-width: 1=
; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-=
width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; =
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-styl=
e: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &q=
uot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13=
px; font-style: normal; font-variant: normal; font-weight: 400; letter-spac=
ing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margi=
n-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-rig=
ht: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-in=
dent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-spac=
e: normal; word-spacing: 0px;">template<class T></div><div style=3D"b=
ackground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-=
bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; borde=
r-image-repeat: stretch; border-image-slice: 100%; border-image-source: non=
e; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-s=
tyle: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bo=
rder-right-style: none; border-right-width: 0px; border-top-color: rgb(34, =
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, =
34); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,s=
ans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-=
weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; =
margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; paddin=
g-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-d=
ecoration: none; text-indent: 0px; text-transform: none; -webkit-text-strok=
e-width: 0px; white-space: normal; word-spacing: 0px;">class unique_ptr</di=
v><div style=3D"background-color: transparent; border-bottom-color: rgb(34,=
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image=
-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-=
image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 3=
4); border-left-style: none; border-left-width: 0px; border-right-color: rg=
b(34, 34, 34); border-right-style: none; border-right-width: 0px; border-to=
p-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; co=
lor: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Helv=
etica&quot;,sans-serif; font-size: 13px; font-style: normal; font-varia=
nt: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; m=
argin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bo=
ttom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-al=
ign: left; text-decoration: none; text-indent: 0px; text-transform: none; -=
webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">{</=
div><div style=3D"background-color: transparent; border-bottom-color: rgb(3=
4, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-ima=
ge-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; borde=
r-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34,=
34); border-left-style: none; border-left-width: 0px; border-right-color: =
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-=
top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; =
color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;He=
lvetica&quot;,sans-serif; font-size: 13px; font-style: normal; font-var=
iant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px;=
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-=
bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-=
align: left; text-decoration: none; text-indent: 0px; text-transform: none;=
-webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=
=C2=A0 ...</div><div style=3D"background-color: transparent; border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
100%; border-image-source: none; border-image-width: 1; border-left-color:=
rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,=
&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: norm=
al; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-=
bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans:=
2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top=
: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-tran=
sform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spac=
ing: 0px;">=C2=A0=C2=A0<span style=3D"background-color: transparent; border=
-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-wi=
dth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-imag=
e-slice: 100%; border-image-source: none; border-image-width: 1; border-lef=
t-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; =
border-right-color: rgb(34, 34, 34); border-right-style: none; border-right=
-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bor=
der-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; f=
ont-size: 13px; font-style: normal; font-variant: normal; font-weight: 400;=
letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right=
: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px;=
padding-right: 0px; padding-top: 0px; text-align: left; text-decoration: n=
one; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px=
; white-space: normal; word-spacing: 0px;"> [[dependent_lifetime(*_p)]] </s=
pan>T* get() { return _p; }</div><div style=3D"background-color: transparen=
t; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-=
bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; bo=
rder-image-slice: 100%; border-image-source: none; border-image-width: 1; b=
order-left-color: rgb(34, 34, 34); border-left-style: none; border-left-wid=
th: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; bor=
der-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: =
none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot=
;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px;=
font-style: normal; font-variant: normal; font-weight: 400; letter-spacing=
: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-t=
op: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right:=
0px; padding-top: 0px; text-align: left; text-decoration: none; text-inden=
t: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: =
normal; word-spacing: 0px;">=C2=A0 ...</div><div style=3D"background-color:=
transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: no=
ne; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: =
stretch; border-image-slice: 100%; border-image-source: none; border-image-=
width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bord=
er-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style=
: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-=
top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family=
: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-=
size: 13px; font-style: normal; font-variant: normal; font-weight: 400; let=
ter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0p=
x; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pad=
ding-right: 0px; padding-top: 0px; text-align: left; text-decoration: none;=
text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; wh=
ite-space: normal; word-spacing: 0px;">=C2=A0 T* _p;</div><div style=3D"bac=
kground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bo=
ttom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-=
image-repeat: stretch; border-image-slice: 100%; border-image-source: none;=
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-sty=
le: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bord=
er-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34=
, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34=
); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,san=
s-serif; font-size: 13px; font-style: normal; font-variant: normal; font-we=
ight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-=
left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-dec=
oration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-=
width: 0px; white-space: normal; word-spacing: 0px;">};</div></div><b></b><=
i></i><u></u><sub></sub><sup></sup><strike></strike></div><div><br></div><d=
iv>Now it is an error to use T* after ~T(), and <span style=3D"display: inl=
ine !important; float: none; background-color: transparent; color: rgb(34, =
34, 34); font-family: "Arial","Helvetica",sans-serif; f=
ont-size: 13px; font-style: normal; font-variant: normal; font-weight: 400;=
letter-spacing: normal; orphans: 2; text-align: left; text-decoration: non=
e; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; =
white-space: normal; word-spacing: 0px;">~T(),=C2=A0</span> can come from a=
ny place - shared_ptr, manual delete, another, moved into unique_ptr. Every=
where.</div><div><br></div><div>And the rules are still the same - no use o=
f this T* variable, after a ~T(), until this T* variable goes out of scope =
("as if" it has a dtor called).=C2=A0</div><div><br></div><div>Th=
e relationship is still b/w an automatic variable and a dtor call.=C2=A0</d=
iv><div><br></div><div><br></div><div><br></div><div>Am I fooling myself he=
re? Isn't that mighty useful? <span style=3D"display: inline !important=
; float: none; background-color: transparent; color: rgb(34, 34, 34); font-=
family: "Arial","Helvetica",sans-serif; font-size: 13px=
; font-style: normal; font-variant: normal; font-weight: 400; letter-spacin=
g: normal; orphans: 2; text-align: left; text-decoration: none; text-indent=
: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: n=
ormal; word-spacing: 0px;">Isn't that all implementable today? What is =
the harm - it does not even writes off lifetime extension and what not - it=
just reinforces safe use of the language, the way this language is right n=
ow. </span></div><div><span style=3D"display: inline !important; float: non=
e; background-color: transparent; color: rgb(34, 34, 34); font-family: &quo=
t;Arial","Helvetica",sans-serif; font-size: 13px; font-style=
: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; o=
rphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-=
transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-=
spacing: 0px;"><br></span></div><div><span style=3D"display: inline !import=
ant; float: none; background-color: transparent; color: rgb(34, 34, 34); fo=
nt-family: "Arial","Helvetica",sans-serif; font-size: 1=
3px; font-style: normal; font-variant: normal; font-weight: 400; letter-spa=
cing: normal; orphans: 2; text-align: left; text-decoration: none; text-ind=
ent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space=
: normal; word-spacing: 0px;">No new semantics, no new rules! (Arguably, no=
new tooling)</span></div><div><b><br></b></div><div><br></div><div style=
=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); font-family: &quot;Arial&quot;,&quot;Helvetica&qu=
ot;,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; =
font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; p=
adding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; t=
ext-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-=
stroke-width: 0px; white-space: normal; word-spacing: 0px;"><br></div><div =
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34=
); border-bottom-style: none; border-bottom-width: 0px; border-image-outset=
: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-s=
ource: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bor=
der-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 3=
4, 34); border-right-style: none; border-right-width: 0px; border-top-color=
: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rg=
b(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Helvetica&a=
mp;quot;,sans-serif; font-size: 13px; font-style: normal; font-variant: nor=
mal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0=
px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: le=
ft; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-=
text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><i style=
=3D"background-attachment: scroll; background-clip: border-box; background-=
color: transparent; background-image: none; background-origin: padding-box;=
background-position-x: 0%; background-position-y: 0%; background-repeat: r=
epeat; background-size: auto; border-bottom-color: rgb(34, 34, 34); border-=
bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; borde=
r-image-repeat: stretch; border-image-slice: 100%; border-image-source: non=
e; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-s=
tyle: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bo=
rder-right-style: none; border-right-width: 0px; border-top-color: rgb(34, =
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, =
34); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;,s=
ans-serif; font-size: 13px; height: auto; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; min-width: 0px; overflow: visible;=
overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px;"><font face=3D"arial,sans-ser=
if" style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: non=
e; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: s=
tretch; border-image-slice: 100%; border-image-source: none; border-image-w=
idth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; borde=
r-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style:=
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-t=
op-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px=
; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0p=
x; padding-right: 0px; padding-top: 0px;"><b style=3D"background-attachment=
: scroll; background-clip: border-box; background-color: transparent; backg=
round-image: none; background-origin: padding-box; background-position-x: 0=
%; background-position-y: 0%; background-repeat: repeat; background-size: a=
uto; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; borde=
r-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; =
border-image-slice: 100%; border-image-source: none; border-image-width: 1;=
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-w=
idth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; b=
order-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style=
: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: arial,s=
ans-serif; font-size: 13px; height: auto; margin-bottom: 0px; margin-left: =
0px; margin-right: 0px; margin-top: 0px; min-width: 0px; overflow: visible;=
overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px;"><u style=3D"background-attac=
hment: scroll; background-clip: border-box; background-color: transparent; =
background-image: none; background-origin: padding-box; background-position=
-x: 0%; background-position-y: 0%; background-repeat: repeat; background-si=
ze: auto; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; =
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stre=
tch; border-image-slice: 100%; border-image-source: none; border-image-widt=
h: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-l=
eft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: no=
ne; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-=
style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: ar=
ial,sans-serif; font-size: 13px; height: auto; margin-bottom: 0px; margin-l=
eft: 0px; margin-right: 0px; margin-top: 0px; min-width: 0px; overflow: vis=
ible; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; paddin=
g-left: 0px; padding-right: 0px; padding-top: 0px;"><br style=3D"background=
-attachment: scroll; background-clip: border-box; background-color: transpa=
rent; background-image: none; background-origin: padding-box; background-po=
sition-x: 0%; background-position-y: 0%; background-repeat: repeat; backgro=
und-size: auto; border-bottom-color: rgb(34, 34, 34); border-bottom-style: =
none; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat=
: stretch; border-image-slice: 100%; border-image-source: none; border-imag=
e-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bo=
rder-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-sty=
le: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); borde=
r-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-fami=
ly: arial,sans-serif; font-size: 13px; height: auto; margin-bottom: 0px; ma=
rgin-left: 0px; margin-right: 0px; margin-top: 0px; min-width: 0px; overflo=
w: visible; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; =
padding-left: 0px; padding-right: 0px; padding-top: 0px;"></u></b></font></=
i></div><blockquote class=3D"gmail_quote" style=3D"background-color: transp=
arent; border-left-color: rgb(204, 204, 204); border-left-style: solid; bor=
der-left-width: 1px; color: rgb(34, 34, 34); font-family: &quot;Arial&a=
mp;quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-st=
yle: normal; font-variant: normal; font-weight: 400; letter-spacing: normal=
; margin-bottom: 0px; margin-left: 5.38px; margin-right: 0px; margin-top: 0=
px; orphans: 2; padding-left: 6.73px; text-align: left; text-decoration: no=
ne; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px;=
white-space: normal; word-spacing: 0px;"><div style=3D"border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top:=
0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-t=
op: 0px;" dir=3D"ltr"><div style=3D"border-bottom-color: rgb(34, 34, 34); b=
order-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0;=
border-image-repeat: stretch; border-image-slice: 100%; border-image-sourc=
e: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-=
left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 3=
4); border-right-style: none; border-right-width: 0px; border-top-color: rg=
b(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-bottom=
: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom=
: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"></div></di=
v></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/3a7fada1-f9f5-45d0-892f-74ccdf8eac2a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/3a7fada1-f9f5-45d0-892f-74ccdf8eac2a=
%40isocpp.org</a>.<br />
------=_Part_2493_1779585719.1516278712802--
------=_Part_2492_1402644001.1516278712798--
.
Author: mihailnajdenov@gmail.com
Date: Thu, 18 Jan 2018 04:35:12 -0800 (PST)
Raw View
------=_Part_2436_2018171762.1516278912639
Content-Type: multipart/alternative;
boundary="----=_Part_2437_461684969.1516278912640"
------=_Part_2437_461684969.1516278912640
Content-Type: text/plain; charset="UTF-8"
For the sake of completeness, in cases when the viewed class creates the
view, then the && overload should be marked as [[dependent_lifetime]]
class string
{
...
[[dependent_lifetime]] operator string_view() && { return {c_str(),
size()}; } //< (probably not the correct place to set the attribute, but
you get the idea)
};
Now the returned value (the variable created from it) depends on the
lifetime of *this and should not be used after *this is dtor is called.
*Further investigation *
Consider that case:
void f()
{
string_view v;
if(const auto str = getString(); str == "something")
{
v = str;
}
// 'v' is either empty or dangles!
}
The above mistake can happen even to an experienced programmer (if he is
used to ref-counted strings for instance). People learning C++ and junior
developers are basically guaranteed to fall in there at some point.
Here it is *painfully* obvious the compiler knows the right usage - he just
keeps it shut! We *should* be able to make him speak.
BTW, that is an interesting case, as it is not about initialization, but
assignment. However, does it matter? It is still clear the scope of
tracking - from assignment tor dtor.
Even if we have a more involved case
void f( string_view& v)
{
if(const auto str = getString(); str == "something")
{
v = str;
}
}
int main()
{
string_view& v;
f(v);
return 0;
}
The compiler still knows all that is needed, doesn't it? As long as the
view is an automatic variable the compiler can always detected if, during
its lifetime, it is used after the pointed-to dtor is called.
Isn't that always the case? Isn't that that case even if the pointed-to is
heap allocated?
o_view v = o_p->getView();
The compiler can still tell if *o_p is destroyed before v is destroyed. Am
I mistaken here?
Considering view classes are 99.9% of the time used as automatic variables,
there is no good reason for them to be unsafe.
(Or maybe there is, I might be missing something)
*And lets talk copies.*
Nothing is actually preventing this tracking to work for copies of the view
as well - the rules are exactly the same - if before view.~view() there is
a call to object.~object() there should be no view,access().
How many views are, it does not matter at all as long as they are
automatic.
It also does not matter if ~object() was called by the compiler
(automatic), the user (delete p_object;) or by a ref counted shared_ptr!
With that in mind.
void f(view<B> vb) //< by copy
{
destroy_b_unknowingly();
vb.use(); //< warning, dtor of b was called already
}
*Even further investigation*
template<class T>
class unique_ptr
{
...
[[dependent_lifetime]] T* get() { return _p; }
...
T* _p;
};
Now the variable of type T* is a view to the unique_ptr. If ~unique_ptr()
is called before the (automatic) T* variable, created/assigned by get, goes
out of scope, it will be an error to use that variable.
But, lets take this to the next level:
template<class T>
class unique_ptr
{
...
[[dependent_lifetime(*_p)]] T* get() { return _p; }
...
T* _p;
};
Now it is an error to use T* after ~T(), and ~T(), can come from any place
- shared_ptr, manual delete, another, moved into unique_ptr. Everywhere.
And the rules are still the same - no use of this T* variable, after a
~T(), until this T* variable goes out of scope ("as if" it has a dtor
called).
The relationship is still b/w an automatic variable and a dtor call.
Am I fooling myself here? Isn't that mighty useful? Isn't that all
implementable today? What is the harm? It does not even writes off lifetime
extension and what not - it just reinforces safe use of the language, the
way this language is right now.
No new semantics, no new rules!
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-bcde-a026e90c3838%40isocpp.org.
------=_Part_2437_461684969.1516278912640
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>For the sake of completeness, in cases when the viewe=
d class creates the view, then the && overload should be marked as =
[[dependent_lifetime]] </div><div><br></div><div><font face=3D"courier new,=
monospace">class string<br>{<br>=C2=A0 ...<br>=C2=A0 [[dependent_lifetime]]=
operator string_view() && { return {c_str(), size()}; } //< (pr=
obably not the correct place to set the attribute, but you get the idea)<br=
>};</font></div><div><font face=3D"courier new"><br></font></div><div>Now t=
he returned value (the variable created from it) depends on the lifetime of=
*this and should not be used after *this is dtor is called. </div><div><br=
></div><div><b>Further investigation </b></div><div><b></b><br>Consider tha=
t case:</div><div><br></div><div><font face=3D"courier new,monospace">void =
f()<br>{<br>=C2=A0 string_view v;<br>=C2=A0<br>=C2=A0if(const auto str =3D =
getString(); str =3D=3D "something")<br>=C2=A0{<br>=C2=A0=C2=A0=
=C2=A0 v =3D str;<br>=C2=A0}<br>=C2=A0 <br>=C2=A0// 'v' is either e=
mpty or dangles!<br>}</font></div><div><font face=3D"courier new,monospace"=
><br></font></div><div>The above mistake can happen even to an experienced =
programmer (if he is used to ref-counted strings for instance). People lear=
ning C++ and junior developers are basically guaranteed to fall in there at=
some point.</div><div><br></div><div>Here it is <i>painfully</i> obvious t=
he compiler knows the right usage - he just keeps it shut! We <i>should</i>=
be able to make him speak.</div><div><br></div><div>BTW, that is an intere=
sting case, as it is not about initialization, but assignment. However, doe=
s it matter? It is still clear the scope of tracking - from assignment tor =
dtor.</div><div><br></div><div>Even if we have a more involved case</div><d=
iv><br></div><div><font face=3D"courier new,monospace">void f( string_view&=
amp; v)<br>{<br>=C2=A0if(const auto str =3D getString(); str =3D=3D "s=
omething")<br>=C2=A0{<br>=C2=A0=C2=A0=C2=A0 v =3D str;<br>=C2=A0}<br>}=
</font></div><div><font face=3D"courier new,monospace">int main()<br>{<br>=
=C2=A0string_view& v;<br>=C2=A0f(v);</font></div><div><font face=3D"cou=
rier new,monospace">=C2=A0return 0;<br>}</font></div><div><font face=3D"cou=
rier new,monospace"><br></font></div><div>The compiler still knows all that=
is needed, doesn't it? As long as the view is an automatic variable th=
e compiler can always detected if, during its lifetime, it is used after th=
e pointed-to dtor is called.</div><div>Isn't that always the case? Isn&=
#39;t that that case even if the pointed-to is heap allocated? </div><div><=
br></div><div><font face=3D"courier new,monospace">o_view v =3D o_p->get=
View();</font></div><div><font face=3D"courier new,monospace"><br></font></=
div><div>The compiler can still tell if *o_p is destroyed before v is destr=
oyed. Am I mistaken here? </div><div><br></div><div>Considering view classe=
s are 99.9% of the time used as automatic variables, there is no good reaso=
n for them to be unsafe. </div><div><br></div><div>(Or maybe there is, I mi=
ght be missing something)</div><div><br></div><div><b><br>And lets talk cop=
ies.</b></div><div><b><br></b></div><div>Nothing is actually preventing thi=
s tracking to work for copies of the view as well - the rules are exactly t=
he same - if before view.~view() there is a call to object.~object() there =
should be no view,access(). </div><div>How many views are, it does not matt=
er at all as long as they are automatic. </div><div>It also does not matter=
if ~object() was called by the compiler (automatic), the user (delete p_ob=
ject;) or by a ref counted shared_ptr!</div><div><br>With that in mind.</di=
v><div><br></div><div><font face=3D"courier new,monospace">void f(view<B=
> vb) //< by copy<br>{<br>=C2=A0=C2=A0 destroy_b_unknowingly();</font=
></div><div><font face=3D"courier new,monospace">=C2=A0 vb.use(); //< wa=
rning, dtor of b was called already<br>}</font></div><div><font face=3D"cou=
rier new,monospace"><br></font></div><div><b>Even further investigation</b>=
</div><div><b><br></b></div><div><font face=3D"courier new,monospace">templ=
ate<class T><br>class unique_ptr<br>{<br>=C2=A0 ...<br>=C2=A0 [[depen=
dent_lifetime]] T* get() { return _p; }<br>=C2=A0 ...<br>=C2=A0 T* _p;<br>}=
;</font></div><div><font face=3D"courier new,monospace"></font><br>Now the =
variable of type T* is a view to the unique_ptr. If ~unique_ptr() is called=
before the (automatic) T* variable, created/assigned by get, goes out of s=
cope, it will be an error to use that variable. </div><div><br>But, lets ta=
ke this to the next level:</div><div><br></div><div><font face=3D"courier n=
ew,monospace">template<class T><br>class unique_ptr<br>{<br>=C2=A0 ..=
..<br>=C2=A0 [[dependent_lifetime(*_p)]] T* get() { return _p; }<br>=C2=A0 .=
...<br>=C2=A0 T* _p;<br>};</font></div><div><font face=3D"courier new,monosp=
ace"><br></font></div><div>Now it is an error to use T* after ~T(), and ~T(=
),=C2=A0 can come from any place - shared_ptr, manual delete, another, move=
d into unique_ptr. Everywhere.</div><div>And the rules are still the same -=
no use of this T* variable, after a ~T(), until this T* variable goes out =
of scope ("as if" it has a dtor called). </div><div>The relations=
hip is still b/w an automatic variable and a dtor call. </div><div><br></di=
v><div>Am I fooling myself here? Isn't that mighty useful? Isn't th=
at all implementable today? What is the harm? It does not even writes off l=
ifetime extension and what not - it just reinforces safe use of the languag=
e, the way this language is right now. <br>No new semantics, no new rules! =
</div><div><br></div><div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-bcde-a026e90c3838%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-bcde-a026e90c3838=
%40isocpp.org</a>.<br />
------=_Part_2437_461684969.1516278912640--
------=_Part_2436_2018171762.1516278912639--
.
Author: Richard Hodges <hodges.r@gmail.com>
Date: Thu, 18 Jan 2018 15:40:55 +0100
Raw View
--001a113f836c9a27fb05630df390
Content-Type: text/plain; charset="UTF-8"
On the whole I completely agree with you.
However:
auto up1 = std::make_unique<int>(5);
auto p = up1.get(); // dependent...
auto up2 = std::move(up1); // ...sort of
std::string_view should never have been implicitly convertible from
std::string. Unhappily, the committee seems to favour encouraging dangerous
coding practices at the moment. Consider:
std::string foo();
std::string_view x = foo();
x.anything(); // boom!
whereas:
std::string const& x = foo(); // perfectly safe
auto x = foo(); // again, safe
auto&& x = foo(); // yet again
IMHO proliferating reference types in the c++ standard library is a grave
error which will haunt us for years.
On 18 January 2018 at 13:35, <mihailnajdenov@gmail.com> wrote:
> For the sake of completeness, in cases when the viewed class creates the
> view, then the && overload should be marked as [[dependent_lifetime]]
>
> class string
> {
> ...
> [[dependent_lifetime]] operator string_view() && { return {c_str(),
> size()}; } //< (probably not the correct place to set the attribute, but
> you get the idea)
> };
>
> Now the returned value (the variable created from it) depends on the
> lifetime of *this and should not be used after *this is dtor is called.
>
> *Further investigation *
>
> Consider that case:
>
> void f()
> {
> string_view v;
>
> if(const auto str = getString(); str == "something")
> {
> v = str;
> }
>
> // 'v' is either empty or dangles!
> }
>
> The above mistake can happen even to an experienced programmer (if he is
> used to ref-counted strings for instance). People learning C++ and junior
> developers are basically guaranteed to fall in there at some point.
>
> Here it is *painfully* obvious the compiler knows the right usage - he
> just keeps it shut! We *should* be able to make him speak.
>
> BTW, that is an interesting case, as it is not about initialization, but
> assignment. However, does it matter? It is still clear the scope of
> tracking - from assignment tor dtor.
>
> Even if we have a more involved case
>
> void f( string_view& v)
> {
> if(const auto str = getString(); str == "something")
> {
> v = str;
> }
> }
> int main()
> {
> string_view& v;
> f(v);
> return 0;
> }
>
> The compiler still knows all that is needed, doesn't it? As long as the
> view is an automatic variable the compiler can always detected if, during
> its lifetime, it is used after the pointed-to dtor is called.
> Isn't that always the case? Isn't that that case even if the pointed-to is
> heap allocated?
>
> o_view v = o_p->getView();
>
> The compiler can still tell if *o_p is destroyed before v is destroyed. Am
> I mistaken here?
>
> Considering view classes are 99.9% of the time used as automatic
> variables, there is no good reason for them to be unsafe.
>
> (Or maybe there is, I might be missing something)
>
>
> *And lets talk copies.*
>
> Nothing is actually preventing this tracking to work for copies of the
> view as well - the rules are exactly the same - if before view.~view()
> there is a call to object.~object() there should be no view,access().
> How many views are, it does not matter at all as long as they are
> automatic.
> It also does not matter if ~object() was called by the compiler
> (automatic), the user (delete p_object;) or by a ref counted shared_ptr!
>
> With that in mind.
>
> void f(view<B> vb) //< by copy
> {
> destroy_b_unknowingly();
> vb.use(); //< warning, dtor of b was called already
> }
>
> *Even further investigation*
>
> template<class T>
> class unique_ptr
> {
> ...
> [[dependent_lifetime]] T* get() { return _p; }
> ...
> T* _p;
> };
>
> Now the variable of type T* is a view to the unique_ptr. If ~unique_ptr()
> is called before the (automatic) T* variable, created/assigned by get, goes
> out of scope, it will be an error to use that variable.
>
> But, lets take this to the next level:
>
> template<class T>
> class unique_ptr
> {
> ...
> [[dependent_lifetime(*_p)]] T* get() { return _p; }
> ...
> T* _p;
> };
>
> Now it is an error to use T* after ~T(), and ~T(), can come from any
> place - shared_ptr, manual delete, another, moved into unique_ptr.
> Everywhere.
> And the rules are still the same - no use of this T* variable, after a
> ~T(), until this T* variable goes out of scope ("as if" it has a dtor
> called).
> The relationship is still b/w an automatic variable and a dtor call.
>
> Am I fooling myself here? Isn't that mighty useful? Isn't that all
> implementable today? What is the harm? It does not even writes off lifetime
> extension and what not - it just reinforces safe use of the language, the
> way this language is right now.
> No new semantics, no new rules!
>
>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-
> bcde-a026e90c3838%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-bcde-a026e90c3838%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hb2oDZ6VwFF-3Ra0rN29bTgtEgwtifLo2w2uzBpkm--3A%40mail.gmail.com.
--001a113f836c9a27fb05630df390
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On the whole I completely agree with you.<div><br></div><d=
iv>However:</div><div><br></div><div><font face=3D"monospace, monospace">au=
to up1 =3D std::make_unique<int>(5);</font></div><div><font face=3D"m=
onospace, monospace">auto p =3D up1.get();=C2=A0 =C2=A0// dependent...</fon=
t></div><div><font face=3D"monospace, monospace">auto up2 =3D std::move(up1=
);=C2=A0 // ...sort of</font></div><div><br></div><div><font face=3D"monosp=
ace, monospace">std::string_view</font> should never have been implicitly c=
onvertible from <font face=3D"monospace, monospace">std::string</font>. Unh=
appily, the committee seems to favour encouraging dangerous coding practice=
s at the moment. Consider:</div><div><br></div><div><font face=3D"monospace=
, monospace">std::string foo();</font></div><div><font face=3D"monospace, m=
onospace"><br></font></div><div><font face=3D"monospace, monospace">std::st=
ring_view x =3D foo();</font></div><div><font face=3D"monospace, monospace"=
>x.anything(); // boom!</font></div><div><br></div><div>whereas:</div><div>=
<font face=3D"monospace, monospace">std::string const& x =3D foo();=C2=
=A0 // perfectly safe</font></div><div><font face=3D"monospace, monospace">=
auto x =3D foo(); // again, safe</font></div><div><font face=3D"monospace, =
monospace">auto&& x =3D foo(); // yet again</font></div><div><font =
face=3D"monospace, monospace"><br></font></div><div><font face=3D"arial, he=
lvetica, sans-serif">IMHO proliferating reference types in the c++ standard=
library is a grave error which will haunt us for years.</font></div><div><=
font face=3D"monospace, monospace"><br></font></div><div><br></div><div><br=
></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On 1=
8 January 2018 at 13:35, <span dir=3D"ltr"><<a href=3D"mailto:mihailnaj=
denov@gmail.com" target=3D"_blank">mihailnajdenov@gmail.com</a>></span> =
wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div class=
=3D"h5"><div>For the sake of completeness, in cases when the viewed class c=
reates the view, then the && overload should be marked as [[depende=
nt_lifetime]] </div><div><br></div><div><font face=3D"courier new,monospace=
">class string<br>{<br>=C2=A0 ...<br>=C2=A0 [[dependent_lifetime]] operator=
string_view() && { return {c_str(), size()}; } //< (probably no=
t the correct place to set the attribute, but you get the idea)<br>};</font=
></div><div><font face=3D"courier new"><br></font></div><div>Now the return=
ed value (the variable created from it) depends on the lifetime of *this an=
d should not be used after *this is dtor is called. </div><div><br></div><d=
iv><b>Further investigation </b></div><div><b></b><br>Consider that case:</=
div><div><br></div><div><font face=3D"courier new,monospace">void f()<br>{<=
br>=C2=A0 string_view v;<br>=C2=A0<br>=C2=A0if(const auto str =3D getString=
(); str =3D=3D "something")<br>=C2=A0{<br>=C2=A0=C2=A0=C2=A0 v =
=3D str;<br>=C2=A0}<br>=C2=A0 <br>=C2=A0// 'v' is either empty or d=
angles!<br>}</font></div><div><font face=3D"courier new,monospace"><br></fo=
nt></div><div>The above mistake can happen even to an experienced programme=
r (if he is used to ref-counted strings for instance). People learning C++ =
and junior developers are basically guaranteed to fall in there at some poi=
nt.</div><div><br></div><div>Here it is <i>painfully</i> obvious the compil=
er knows the right usage - he just keeps it shut! We <i>should</i> be able =
to make him speak.</div><div><br></div><div>BTW, that is an interesting cas=
e, as it is not about initialization, but assignment. However, does it matt=
er? It is still clear the scope of tracking - from assignment tor dtor.</di=
v><div><br></div><div>Even if we have a more involved case</div><div><br></=
div></div></div><div><font face=3D"courier new,monospace">void f( string_vi=
ew& v)<br>{<span class=3D""><br>=C2=A0if(const auto str =3D getString()=
; str =3D=3D "something")<br>=C2=A0{<br>=C2=A0=C2=A0=C2=A0 v =3D =
str;<br>=C2=A0}<br>}</span></font></div><div><font face=3D"courier new,mono=
space">int main()<br>{<br>=C2=A0string_view& v;<br>=C2=A0f(v);</font></=
div><div><font face=3D"courier new,monospace">=C2=A0return 0;<br>}</font></=
div><div><font face=3D"courier new,monospace"><br></font></div><div>The com=
piler still knows all that is needed, doesn't it? As long as the view i=
s an automatic variable the compiler can always detected if, during its lif=
etime, it is used after the pointed-to dtor is called.</div><div>Isn't =
that always the case? Isn't that that case even if the pointed-to is he=
ap allocated? </div><div><br></div><div><font face=3D"courier new,monospace=
">o_view v =3D o_p->getView();</font></div><div><font face=3D"courier ne=
w,monospace"><br></font></div><div>The compiler can still tell if *o_p is d=
estroyed before v is destroyed. Am I mistaken here? </div><div><br></div><d=
iv>Considering view classes are 99.9% of the time used as automatic variabl=
es, there is no good reason for them to be unsafe. </div><div><br></div><di=
v>(Or maybe there is, I might be missing something)</div><div><br></div><di=
v><b><br>And lets talk copies.</b></div><div><b><br></b></div><div>Nothing =
is actually preventing this tracking to work for copies of the view as well=
- the rules are exactly the same - if before view.~view() there is a call =
to object.~object() there should be no view,access(). </div><div>How many v=
iews are, it does not matter at all as long as they are automatic. </div><d=
iv>It also does not matter if ~object() was called by the compiler (automat=
ic), the user (delete p_object;) or by a ref counted shared_ptr!</div><div>=
<br>With that in mind.</div><div><br></div><div><font face=3D"courier new,m=
onospace">void f(view<B> vb) //< by copy<br>{<br>=C2=A0=C2=A0 dest=
roy_b_unknowingly();</font></div><div><font face=3D"courier new,monospace">=
=C2=A0 vb.use(); //< warning, dtor of b was called already<br>}</font></=
div><div><font face=3D"courier new,monospace"><br></font></div><div><b>Even=
further investigation</b></div><div><b><br></b></div><div><font face=3D"co=
urier new,monospace">template<class T><br>class unique_ptr<br>{<br>=
=C2=A0 ...<br>=C2=A0 [[dependent_lifetime]] T* get() { return _p; }<br>=C2=
=A0 ...<br>=C2=A0 T* _p;<br>};</font></div><div><font face=3D"courier new,m=
onospace"></font><br>Now the variable of type T* is a view to the unique_pt=
r. If ~unique_ptr() is called before the (automatic) T* variable, created/a=
ssigned by get, goes out of scope, it will be an error to use that variable=
.. </div><div><br>But, lets take this to the next level:</div><div><br></div=
><div><font face=3D"courier new,monospace">template<class T><br>class=
unique_ptr<br>{<br>=C2=A0 ...<br>=C2=A0 [[dependent_lifetime(*_p)]] T* get=
() { return _p; }<br>=C2=A0 ...<br>=C2=A0 T* _p;<br>};</font></div><div><fo=
nt face=3D"courier new,monospace"><br></font></div><div>Now it is an error =
to use T* after ~T(), and ~T(),=C2=A0 can come from any place - shared_ptr,=
manual delete, another, moved into unique_ptr. Everywhere.</div><div>And t=
he rules are still the same - no use of this T* variable, after a ~T(), unt=
il this T* variable goes out of scope ("as if" it has a dtor call=
ed). </div><div>The relationship is still b/w an automatic variable and a d=
tor call. </div><div><br></div><div>Am I fooling myself here? Isn't tha=
t mighty useful? Isn't that all implementable today? What is the harm? =
It does not even writes off lifetime extension and what not - it just reinf=
orces safe use of the language, the way this language is right now. <br>No =
new semantics, no new rules! </div><div><br></div><div><br></div></div><spa=
n class=3D"">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-bcde-a026e90c3838%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/6e78=
f3c4-267d-40c4-<wbr>bcde-a026e90c3838%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALvx3hb2oDZ6VwFF-3Ra0rN29bTgtEgwtifL=
o2w2uzBpkm--3A%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hb2oDZ6VwFF=
-3Ra0rN29bTgtEgwtifLo2w2uzBpkm--3A%40mail.gmail.com</a>.<br />
--001a113f836c9a27fb05630df390--
.
Author: mihailnajdenov@gmail.com
Date: Thu, 18 Jan 2018 09:25:53 -0800 (PST)
Raw View
------=_Part_3305_1147788563.1516296353442
Content-Type: multipart/alternative;
boundary="----=_Part_3306_1297655227.1516296353443"
------=_Part_3306_1297655227.1516296353443
Content-Type: text/plain; charset="UTF-8"
On Thursday, January 18, 2018 at 4:40:58 PM UTC+2, Richard Hodges wrote:
>
> On the whole I completely agree with you.
>
> However:
>
> auto up1 = std::make_unique<int>(5);
> auto p = up1.get(); // dependent...
> auto up2 = std::move(up1); // ...sort of
>
This is completely defined as per second suggested declaration of get().
[[dependent_lifetime(*_p)]] T* get() { return _p; }
p, still depends on the lifetime of the object returned by the new int(5)
call inside make_unique.
All the fancy pointers and/or classes we delegate the lifetime of the int
to, will not hide *when* the delete on that int is called. If this happens
before p is out of scope *and* we try to use p, then we error out.
>
> std::string_view should never have been implicitly convertible from
> std::string. Unhappily, the committee seems to favour encouraging
> dangerous coding practices at the moment.
>
If not with string it will happen with something else - spans,
function_view etc - and most of the time it is expected to be able to just
call the function the way you normally would.
Also, making the conversion explicit buy us too little I think - users will
need to create views explicitly and still shoot themselves by using
temporal objects.
> Consider:
>
> std::string foo();
>
> std::string_view x = foo();
> x.anything(); // boom!
>
> whereas:
> std::string const& x = foo(); // perfectly safe
> auto x = foo(); // again, safe
> auto&& x = foo(); // yet again
>
That is why I really hope some work is done to mandate warnings in a well
defined manner, instead of waiting the implementations to fill the gap by
they own initiative, like always.
As said, more views are coming!
>
> IMHO proliferating reference types in the c++ standard library is a grave
> error which will haunt us for years.
>
I personally like them, because of the abstraction - a base type am
guaranteed to be able to convert to. It is really a form of abstract base
class, but without all the hierarchy requirements and indirection.
Also, a thing like function_view will enable us to finally have functor
pointers - cheap almost zero-cost pointers to anything callable, lambda
included.
There is no alternative to that now - you either must use a template, or
commit to a representation (and conversion) to something like std::function
or my_function or whatever.
>
>
>
>
> On 18 January 2018 at 13:35, <mihailn...@gmail.com <javascript:>> wrote:
>
>> For the sake of completeness, in cases when the viewed class creates the
>> view, then the && overload should be marked as [[dependent_lifetime]]
>>
>> class string
>> {
>> ...
>> [[dependent_lifetime]] operator string_view() && { return {c_str(),
>> size()}; } //< (probably not the correct place to set the attribute, but
>> you get the idea)
>> };
>>
>> Now the returned value (the variable created from it) depends on the
>> lifetime of *this and should not be used after *this is dtor is called.
>>
>> *Further investigation *
>>
>> Consider that case:
>>
>> void f()
>> {
>> string_view v;
>>
>> if(const auto str = getString(); str == "something")
>> {
>> v = str;
>> }
>>
>> // 'v' is either empty or dangles!
>> }
>>
>> The above mistake can happen even to an experienced programmer (if he is
>> used to ref-counted strings for instance). People learning C++ and junior
>> developers are basically guaranteed to fall in there at some point.
>>
>> Here it is *painfully* obvious the compiler knows the right usage - he
>> just keeps it shut! We *should* be able to make him speak.
>>
>> BTW, that is an interesting case, as it is not about initialization, but
>> assignment. However, does it matter? It is still clear the scope of
>> tracking - from assignment tor dtor.
>>
>> Even if we have a more involved case
>>
>> void f( string_view& v)
>> {
>> if(const auto str = getString(); str == "something")
>> {
>> v = str;
>> }
>> }
>> int main()
>> {
>> string_view& v;
>> f(v);
>> return 0;
>> }
>>
>> The compiler still knows all that is needed, doesn't it? As long as the
>> view is an automatic variable the compiler can always detected if, during
>> its lifetime, it is used after the pointed-to dtor is called.
>> Isn't that always the case? Isn't that that case even if the pointed-to
>> is heap allocated?
>>
>> o_view v = o_p->getView();
>>
>> The compiler can still tell if *o_p is destroyed before v is destroyed.
>> Am I mistaken here?
>>
>> Considering view classes are 99.9% of the time used as automatic
>> variables, there is no good reason for them to be unsafe.
>>
>> (Or maybe there is, I might be missing something)
>>
>>
>> *And lets talk copies.*
>>
>> Nothing is actually preventing this tracking to work for copies of the
>> view as well - the rules are exactly the same - if before view.~view()
>> there is a call to object.~object() there should be no view,access().
>> How many views are, it does not matter at all as long as they are
>> automatic.
>> It also does not matter if ~object() was called by the compiler
>> (automatic), the user (delete p_object;) or by a ref counted shared_ptr!
>>
>> With that in mind.
>>
>> void f(view<B> vb) //< by copy
>> {
>> destroy_b_unknowingly();
>> vb.use(); //< warning, dtor of b was called already
>> }
>>
>> *Even further investigation*
>>
>> template<class T>
>> class unique_ptr
>> {
>> ...
>> [[dependent_lifetime]] T* get() { return _p; }
>> ...
>> T* _p;
>> };
>>
>> Now the variable of type T* is a view to the unique_ptr. If ~unique_ptr()
>> is called before the (automatic) T* variable, created/assigned by get, goes
>> out of scope, it will be an error to use that variable.
>>
>> But, lets take this to the next level:
>>
>> template<class T>
>> class unique_ptr
>> {
>> ...
>> [[dependent_lifetime(*_p)]] T* get() { return _p; }
>> ...
>> T* _p;
>> };
>>
>> Now it is an error to use T* after ~T(), and ~T(), can come from any
>> place - shared_ptr, manual delete, another, moved into unique_ptr.
>> Everywhere.
>> And the rules are still the same - no use of this T* variable, after a
>> ~T(), until this T* variable goes out of scope ("as if" it has a dtor
>> called).
>> The relationship is still b/w an automatic variable and a dtor call.
>>
>> Am I fooling myself here? Isn't that mighty useful? Isn't that all
>> implementable today? What is the harm? It does not even writes off lifetime
>> extension and what not - it just reinforces safe use of the language, the
>> way this language is right now.
>> No new semantics, no new rules!
>>
>>
>> --
>> 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-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-bcde-a026e90c3838%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-bcde-a026e90c3838%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/f9301aab-d8c5-4558-a597-5b3d666c4b11%40isocpp.org.
------=_Part_3306_1297655227.1516296353443
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Thursday, January 18, 2018 at 4:40:58 PM UTC+2,=
Richard Hodges wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">On the whole I completely agree with you.<div><br></div><div>Howev=
er:</div><div><br></div><div><font face=3D"monospace, monospace">auto up1 =
=3D std::make_unique<int>(5);</font></div><div><font face=3D"monospac=
e, monospace">auto p =3D up1.get();=C2=A0 =C2=A0// dependent...</font></div=
><div><font face=3D"monospace, monospace">auto up2 =3D std::move(up1);=C2=
=A0 // ...sort of</font></div></div></blockquote><div><br></div><div>This i=
s completely defined as per second suggested declaration of get().</div><di=
v><br></div><div><span style=3D"display: inline !important; float: none; ba=
ckground-color: transparent; color: rgb(34, 34, 34); font-family: courier n=
ew,monospace; font-size: 13px; font-style: normal; font-variant: normal; fo=
nt-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-=
decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stro=
ke-width: 0px; white-space: normal; word-spacing: 0px;">[[dependent_lifetim=
e(*_p)]] T* get() { return _p; }</span></div><div><span style=3D"display: i=
nline !important; float: none; background-color: transparent; color: rgb(34=
, 34, 34); font-family: courier new,monospace; font-size: 13px; font-style:=
normal; font-variant: normal; font-weight: 400; letter-spacing: normal; or=
phans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-t=
ransform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-s=
pacing: 0px;"><br></span></div><div><font face=3D"arial,sans-serif">p, stil=
l depends on the lifetime of the object returned by the <font face=3D"couri=
er new,monospace">new int(5)</font> call inside make_unique.=C2=A0</font></=
div><div><br></div><div>All the fancy pointers and/or classes we delegate t=
he lifetime of the <font face=3D"courier new,monospace">int</font> to, will=
not hide <i>when</i> the delete on that <font face=3D"courier new,monospac=
e">int</font> is called. If this happens before p is out of scope <i>and</i=
> we try to use p, then we error out.</div><div><b><font face=3D"arial,sans=
-serif"><i><br></i></font></b></div><div>=C2=A0</div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc sol=
id;padding-left: 1ex;"><div dir=3D"ltr"><div><br></div><div><font face=3D"m=
onospace, monospace">std::string_view</font> should never have been implici=
tly convertible from <font face=3D"monospace, monospace">std::string</font>=
.. Unhappily, the committee seems to favour encouraging dangerous coding pra=
ctices at the moment. </div></div></blockquote><div><br></div><div>If not w=
ith string it will happen with something else - spans, function_view etc - =
and most of the time it is expected to be able to just call the function th=
e way you normally would.=C2=A0</div><div><br></div><div>Also, making the c=
onversion explicit buy us too little I think - users will need to create vi=
ews explicitly and still shoot themselves by using temporal objects.=C2=A0<=
/div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div>Consider:</div><div><br></div><div><font face=3D"monospace, m=
onospace">std::string foo();</font></div><div><font face=3D"monospace, mono=
space"><br></font></div><div><font face=3D"monospace, monospace">std::strin=
g_view x =3D foo();</font></div><div><font face=3D"monospace, monospace">x.=
anything(); // boom!</font></div><div><br></div><div>whereas:</div><div><fo=
nt face=3D"monospace, monospace">std::string const& x =3D foo();=C2=A0 =
// perfectly safe</font></div><div><font face=3D"monospace, monospace">auto=
x =3D foo(); // again, safe</font></div><div><font face=3D"monospace, mono=
space">auto&& x =3D foo(); // yet again</font></div></div></blockqu=
ote><div><br></div><div>That is why I really hope some work is done to mand=
ate warnings in a well defined manner, instead of waiting the implementatio=
ns to fill the gap by they own initiative, like always.=C2=A0</div><div><br=
></div><div>As said, more views are coming!</div><div>=C2=A0</div><blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><font face=3D"mon=
ospace, monospace"><br></font></div><div><font face=3D"arial, helvetica, sa=
ns-serif">IMHO proliferating reference types in the c++ standard library is=
a grave error which will haunt us for years.</font></div></div></blockquot=
e><div><br></div><div>I personally like them, because of the abstraction - =
a base type am guaranteed to be able to convert to. It is really a form of =
abstract base class, but without all the hierarchy requirements and indirec=
tion.</div><div><br></div><div>Also, a thing like function_view will enable=
us to finally have functor pointers - cheap almost zero-cost pointers to a=
nything callable, lambda included.</div><div><br></div><div>There is no alt=
ernative to that now - you either must use a template, or commit to a repre=
sentation (and conversion) to something like std::function or my_function o=
r whatever.=C2=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;"><div dir=3D"ltr"><div><font face=3D"monospace, monospace"><br></f=
ont></div><div><br></div><div><br></div></div><div><br><div class=3D"gmail_=
quote">On 18 January 2018 at 13:35, <span dir=3D"ltr"><<a onmousedown=
=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D=
'javascript:';return true;" href=3D"javascript:" target=3D"_blank" =
rel=3D"nofollow" gdf-obfuscated-mailto=3D"C5CtV9t3AgAJ">mihailn...@gmail.co=
m</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
<div><div><div>For the sake of completeness, in cases when the viewed class=
creates the view, then the && overload should be marked as [[depen=
dent_lifetime]] </div><div><br></div><div><font face=3D"courier new,monospa=
ce">class string<br>{<br>=C2=A0 ...<br>=C2=A0 [[dependent_lifetime]] operat=
or string_view() && { return {c_str(), size()}; } //< (probably =
not the correct place to set the attribute, but you get the idea)<br>};</fo=
nt></div><div><font face=3D"courier new"><br></font></div><div>Now the retu=
rned value (the variable created from it) depends on the lifetime of *this =
and should not be used after *this is dtor is called. </div><div><br></div>=
<div><b>Further investigation </b></div><div><b></b><br>Consider that case:=
</div><div><br></div><div><font face=3D"courier new,monospace">void f()<br>=
{<br>=C2=A0 string_view v;<br>=C2=A0<br>=C2=A0if(const auto str =3D getStri=
ng(); str =3D=3D "something")<br>=C2=A0{<br>=C2=A0=C2=A0=C2=A0 v =
=3D str;<br>=C2=A0}<br>=C2=A0 <br>=C2=A0// 'v' is either empty or d=
angles!<br>}</font></div><div><font face=3D"courier new,monospace"><br></fo=
nt></div><div>The above mistake can happen even to an experienced programme=
r (if he is used to ref-counted strings for instance). People learning C++ =
and junior developers are basically guaranteed to fall in there at some poi=
nt.</div><div><br></div><div>Here it is <i>painfully</i> obvious the compil=
er knows the right usage - he just keeps it shut! We <i>should</i> be able =
to make him speak.</div><div><br></div><div>BTW, that is an interesting cas=
e, as it is not about initialization, but assignment. However, does it matt=
er? It is still clear the scope of tracking - from assignment tor dtor.</di=
v><div><br></div><div>Even if we have a more involved case</div><div><br></=
div></div></div><div><font face=3D"courier new,monospace">void f( string_vi=
ew& v)<br>{<span><br>=C2=A0if(const auto str =3D getString(); str =3D=
=3D "something")<br>=C2=A0{<br>=C2=A0=C2=A0=C2=A0 v =3D str;<br>=
=C2=A0}<br>}</span></font></div><div><font face=3D"courier new,monospace">i=
nt main()<br>{<br>=C2=A0string_view& v;<br>=C2=A0f(v);</font></div><div=
><font face=3D"courier new,monospace">=C2=A0return 0;<br>}</font></div><div=
><font face=3D"courier new,monospace"><br></font></div><div>The compiler st=
ill knows all that is needed, doesn't it? As long as the view is an aut=
omatic variable the compiler can always detected if, during its lifetime, i=
t is used after the pointed-to dtor is called.</div><div>Isn't that alw=
ays the case? Isn't that that case even if the pointed-to is heap alloc=
ated? </div><div><br></div><div><font face=3D"courier new,monospace">o_view=
v =3D o_p->getView();</font></div><div><font face=3D"courier new,monosp=
ace"><br></font></div><div>The compiler can still tell if *o_p is destroyed=
before v is destroyed. Am I mistaken here? </div><div><br></div><div>Consi=
dering view classes are 99.9% of the time used as automatic variables, ther=
e is no good reason for them to be unsafe. </div><div><br></div><div>(Or ma=
ybe there is, I might be missing something)</div><div><br></div><div><b><br=
>And lets talk copies.</b></div><div><b><br></b></div><div>Nothing is actua=
lly preventing this tracking to work for copies of the view as well - the r=
ules are exactly the same - if before view.~view() there is a call to objec=
t.~object() there should be no view,access(). </div><div>How many views are=
, it does not matter at all as long as they are automatic. </div><div>It al=
so does not matter if ~object() was called by the compiler (automatic), the=
user (delete p_object;) or by a ref counted shared_ptr!</div><div><br>With=
that in mind.</div><div><br></div><div><font face=3D"courier new,monospace=
">void f(view<B> vb) //< by copy<br>{<br>=C2=A0=C2=A0 destroy_b_un=
knowingly();</font></div><div><font face=3D"courier new,monospace">=C2=A0 v=
b.use(); //< warning, dtor of b was called already<br>}</font></div><div=
><font face=3D"courier new,monospace"><br></font></div><div><b>Even further=
investigation</b></div><div><b><br></b></div><div><font face=3D"courier ne=
w,monospace">template<class T><br>class unique_ptr<br>{<br>=C2=A0 ...=
<br>=C2=A0 [[dependent_lifetime]] T* get() { return _p; }<br>=C2=A0 ...<br>=
=C2=A0 T* _p;<br>};</font></div><div><font face=3D"courier new,monospace"><=
/font><br>Now the variable of type T* is a view to the unique_ptr. If ~uniq=
ue_ptr() is called before the (automatic) T* variable, created/assigned by =
get, goes out of scope, it will be an error to use that variable. </div><di=
v><br>But, lets take this to the next level:</div><div><br></div><div><font=
face=3D"courier new,monospace">template<class T><br>class unique_ptr=
<br>{<br>=C2=A0 ...<br>=C2=A0 [[dependent_lifetime(*_p)]] T* get() { return=
_p; }<br>=C2=A0 ...<br>=C2=A0 T* _p;<br>};</font></div><div><font face=3D"=
courier new,monospace"><br></font></div><div>Now it is an error to use T* a=
fter ~T(), and ~T(),=C2=A0 can come from any place - shared_ptr, manual del=
ete, another, moved into unique_ptr. Everywhere.</div><div>And the rules ar=
e still the same - no use of this T* variable, after a ~T(), until this T* =
variable goes out of scope ("as if" it has a dtor called). </div>=
<div>The relationship is still b/w an automatic variable and a dtor call. <=
/div><div><br></div><div>Am I fooling myself here? Isn't that mighty us=
eful? Isn't that all implementable today? What is the harm? It does not=
even writes off lifetime extension and what not - it just reinforces safe =
use of the language, the way this language is right now. <br>No new semanti=
cs, no new rules! </div><div><br></div><div><br></div></div><span>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a onmousedown=3D"this.href=3D'javascript:';return true;" o=
nclick=3D"this.href=3D'javascript:';return true;" href=3D"javascrip=
t:" target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"C5CtV9t3AgA=
J">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a onmousedown=3D"this.href=3D'jav=
ascript:';return true;" onclick=3D"this.href=3D'javascript:';re=
turn true;" href=3D"javascript:" target=3D"_blank" rel=3D"nofollow" gdf-obf=
uscated-mailto=3D"C5CtV9t3AgAJ">std-pr...@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a onmousedown=3D"this.href=3D'=
;https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d=
-40c4-bcde-a026e90c3838%40isocpp.org?utm_medium\x3demail\x26utm_source\x3df=
ooter';return true;" onclick=3D"this.href=3D'https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6e78f3c4-267d-40c4-bcde-a026e90c3838=
%40isocpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;=
" href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/6e78=
f3c4-267d-40c4-bcde-a026e90c3838%40isocpp.org?utm_medium=3Demail&utm_so=
urce=3Dfooter" target=3D"_blank" rel=3D"nofollow">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/6e78f3c4-267d-40c4-<wbr>bcde-=
a026e90c3838%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/f9301aab-d8c5-4558-a597-5b3d666c4b11%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f9301aab-d8c5-4558-a597-5b3d666c4b11=
%40isocpp.org</a>.<br />
------=_Part_3306_1297655227.1516296353443--
------=_Part_3305_1147788563.1516296353442--
.
Author: mihailnajdenov@gmail.com
Date: Fri, 19 Jan 2018 04:30:52 -0800 (PST)
Raw View
------=_Part_5866_1096684638.1516365052739
Content-Type: multipart/alternative;
boundary="----=_Part_5867_532900526.1516365052740"
------=_Part_5867_532900526.1516365052740
Content-Type: text/plain; charset="UTF-8"
I just realized this could make *observer_ptr* finally useful.
Once decorated it will *actually observe* the dtor/free of the original
object is called and warn uses after that.
Observation will be compile-time static analysis, active only in debug mode
and/or a compiler flag.
It will *not* work for heap allocated observers or observers members of
heap allocated object and in case the original object is destroyed in a
different thread.
Still, it would be infinitely more useful then today, because it not only
reinforces semantics, but *help us write correct code.*
If someone writes correct code, then it should be opt-out (the attribute
should be in a namespace 'debug' or 'analyze'). No need to pay the compile
time price if your code is right.
However verification should be "one click away" and targeted (no wide guess
by the analyzer what "correct" is).
Now lets consider something interesting.
std::string str = "good";
std::string_view v = str;
str += "or not";
// bad things waiting to happen
That case is not solved neither by my original suggestion nor the life
extension proposal!
Both are concerned by the lifetime of the holding object and not what the
object holds, however views are most of the time about internal
representation, not the object itself (function_view is major exception).
Views about the object themselves are pointers and references - we have
them already.
Interestingly this case is *trivially solved* by a the improved
observer_ptr.
class string_view
{
...
void friendly_func() { /*does not use _p*/ }
std::observer_ptr _p;
...
};
class string
{
operator string_view () const { return {c_str(), size()}; }
};
Note, string does not need attribute decorations any more!
Also note, now we can call view.friendly_func(), without a warning, even
when the observed object is destroyed. (not sure how usefully this is, just
an observation)
Needless to say, the original example case *should* be now solved as after
the addition the compiler/analyzer should detect that the original string
must be relocated and observer_ptr will dangle.
Interestingly - Is there something besides observer_ptr actually needed?
Can we "just" define special behavior of observer_ptr (in debug/analyze
mode) and solve all cases of lifetime monitoring (under the said
limitations) - from smart pointers to function_view?
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/a395ffbf-fc53-4288-b1ca-f559e1703eac%40isocpp.org.
------=_Part_5867_532900526.1516365052740
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I just realized this could make <b>observer_ptr</b> f=
inally useful.</div><div><br></div><div>Once decorated it will <i>actually =
observe</i> the dtor/free of the original object is called and warn uses af=
ter that. </div><div><br></div><div>Observation will be compile-time static=
analysis, active only in debug mode and/or a compiler flag. </div><div>It =
will <i>not</i> work for heap allocated observers or <span style=3D"display=
: inline !important; float: none; background-color: transparent; color: rgb=
(34, 34, 34); font-family: "Arial","Helvetica",sans-ser=
if; font-size: 13px; font-style: normal; font-variant: normal; font-weight:=
400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration=
: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: =
0px; white-space: normal; word-spacing: 0px;">observers members</span> of h=
eap allocated object and in case the original object is destroyed in a diff=
erent thread.=C2=A0</div><div><br></div><div>Still, it would be infinitely =
more useful then today, because it not only reinforces semantics, but <i>he=
lp us write correct code.</i></div><div><i><br></i></div><div>If someone wr=
ites <span style=3D"text-align: left; color: rgb(34, 34, 34); text-transfor=
m: none; text-indent: 0px; letter-spacing: normal; font-family: "Arial=
","Helvetica",sans-serif; font-size: 13px; font-variant: nor=
mal; font-weight: 400; text-decoration: none; word-spacing: 0px; display: i=
nline !important; white-space: normal; orphans: 2; float: none; -webkit-tex=
t-stroke-width: 0px; background-color: transparent;">correct </span>code, t=
hen it should be opt-out (the attribute should be in a namespace 'debug=
' or 'analyze'). No need to pay the compile time price if your =
code is right. </div><div>However verification should be "one click aw=
ay" and targeted (no wide guess by the analyzer what "correct&quo=
t; is).</div><div><br></div><div><br></div><div>Now lets consider something=
interesting.</div><div><br></div><div><font face=3D"courier new,monospace"=
>std::string str =3D "good";</font></div><div><font face=3D"couri=
er new,monospace">std::string_view v =3D str;</font></div><div><font face=
=3D"courier new"><br></font></div><div><font face=3D"courier new">str +=3D =
"or not";</font></div><div><font face=3D"courier new"><br></font>=
</div><div><font face=3D"courier new">// bad things waiting to happen</font=
></div><div><font face=3D"courier new"><br></font></div><div><font face=3D"=
arial,sans-serif">That case is not solved neither by my original suggestion=
nor the life extension proposal!</font></div><div><font face=3D"arial,sans=
-serif">Both are concerned by the lifetime of the holding object and not wh=
at the object holds, however views are most of the time about internal repr=
esentation, not the object itself (function_view is major exception).</font=
></div><div>Views about the object themselves are pointers and references -=
we have them already.</div><div><br></div><div>Interestingly this case is =
<i>trivially solved</i> by a the improved observer_ptr.</div><div><br></div=
><div><font face=3D"courier new,monospace">class string_view</font></div><d=
iv><font face=3D"courier new,monospace">{</font></div><div><font face=3D"co=
urier new">=C2=A0 ...</font></div><div><font face=3D"courier new">=C2=A0 vo=
id friendly_func() { /*does not use _p*/ }</font></div><div><font face=3D"c=
ourier new,monospace">=C2=A0 std::observer_ptr _p;</font></div><div><font f=
ace=3D"courier new,monospace">=C2=A0 ...</font></div><div><font face=3D"cou=
rier new,monospace">};</font></div><div><font face=3D"courier new"><br></fo=
nt></div><div><font face=3D"courier new,monospace">class string=C2=A0</font=
></div><div><font face=3D"courier new,monospace">{</font></div><div><font f=
ace=3D"courier new,monospace">=C2=A0 operator=C2=A0<span style=3D"text-alig=
n: left; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; le=
tter-spacing: normal; font-size: 13px; font-style: normal; font-variant: no=
rmal; font-weight: 400; text-decoration: none; word-spacing: 0px; display: =
inline !important; white-space: normal; orphans: 2; float: none; -webkit-te=
xt-stroke-width: 0px; background-color: transparent;">string_view () const =
{ return {c_str(), size()}; }</span></font></div><div><font face=3D"courier=
new,monospace">};</font></div><div><br></div><div><font face=3D"arial,sans=
-serif">Note, string does not need attribute decorations any more!</font></=
div><div>Also note, now we can call <font face=3D"courier new,monospace">vi=
e</font><font face=3D"courier new,monospace">w.</font><span style=3D"displa=
y: inline !important; float: none; background-color: transparent; color: rg=
b(34, 34, 34); font-family: courier new; font-size: 13px; font-style: norma=
l; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans:=
2; text-align: left; text-decoration: none; text-indent: 0px; text-transfo=
rm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing=
: 0px;"><font face=3D"courier new,monospace">f</font>riendly_func(),=C2=A0<=
span style=3D"display: inline !important; float: none; background-color: tr=
ansparent; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-size=
: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-=
spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-=
indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-sp=
ace: normal; word-spacing: 0px;">without a warning,</span> <font face=3D"ar=
ial,sans-serif">even when the observed object is destroyed. (not sure how u=
sefully this is, just an observation)=C2=A0</font></span></div><div><span s=
tyle=3D"display: inline !important; float: none; background-color: transpar=
ent; color: rgb(34, 34, 34); font-family: courier new; font-size: 13px; fon=
t-style: normal; font-variant: normal; font-weight: 400; letter-spacing: no=
rmal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px=
; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal=
; word-spacing: 0px;"><font face=3D"Arial"></font></span><span style=3D"dis=
play: inline !important; float: none; background-color: transparent; color:=
rgb(34, 34, 34); font-family: courier new; font-size: 13px; font-style: no=
rmal; font-variant: normal; font-weight: 400; letter-spacing: normal; orpha=
ns: 2; text-align: left; text-decoration: none; text-indent: 0px; text-tran=
sform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spac=
ing: 0px;"><br></span></div><div><span style=3D"display: inline !important;=
float: none; background-color: transparent; color: rgb(34, 34, 34); font-f=
amily: courier new; font-size: 13px; font-style: normal; font-variant: norm=
al; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left;=
text-decoration: none; text-indent: 0px; text-transform: none; -webkit-tex=
t-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><font face=3D=
"Arial">Needless to say, the original example case <i>should</i> be now sol=
ved as after the addition the compiler/analyzer should detect that the orig=
inal string must be relocated and observer_ptr will dangle.</font></span></=
div><div><span style=3D"text-align: left; color: rgb(34, 34, 34); text-tran=
sform: none; text-indent: 0px; letter-spacing: normal; font-size: 13px; fon=
t-style: normal; font-variant: normal; font-weight: 400; text-decoration: n=
one; word-spacing: 0px; display: inline !important; white-space: normal; or=
phans: 2; float: none; -webkit-text-stroke-width: 0px; background-color: tr=
ansparent;"><font face=3D"arial,sans-serif"><br></font></span></div><div><s=
pan style=3D"text-align: left; color: rgb(34, 34, 34); text-transform: none=
; text-indent: 0px; letter-spacing: normal; font-size: 13px; font-style: no=
rmal; font-variant: normal; font-weight: 400; text-decoration: none; word-s=
pacing: 0px; display: inline !important; white-space: normal; orphans: 2; f=
loat: none; -webkit-text-stroke-width: 0px; background-color: transparent;"=
><font face=3D"arial,sans-serif">Interestingly</font></span><font face=3D"a=
rial,sans-serif"> - Is there something besides=C2=A0<span style=3D"text-ali=
gn: left; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; l=
etter-spacing: normal; font-size: 13px; font-style: normal; font-variant: n=
ormal; font-weight: 400; text-decoration: none; word-spacing: 0px; display:=
inline !important; white-space: normal; orphans: 2; float: none; -webkit-t=
ext-stroke-width: 0px; background-color: transparent;">observer_ptr actuall=
y needed?</span></font></div><div><font face=3D"arial,sans-serif"><span sty=
le=3D"text-align: left; color: rgb(34, 34, 34); text-transform: none; text-=
indent: 0px; letter-spacing: normal; font-size: 13px; font-style: normal; f=
ont-variant: normal; font-weight: 400; text-decoration: none; word-spacing:=
0px; display: inline !important; white-space: normal; orphans: 2; float: n=
one; -webkit-text-stroke-width: 0px; background-color: transparent;"> Can w=
e <span style=3D"display: inline !important; float: none; background-color:=
transparent; color: rgb(34, 34, 34); font-family: arial,sans-serif; font-s=
ize: 13px; font-style: normal; font-variant: normal; font-weight: 400; lett=
er-spacing: normal; orphans: 2; text-align: left; text-decoration: none; te=
xt-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white=
-space: normal; word-spacing: 0px;">"just" </span>define special =
behavior of=C2=A0<span style=3D"background-color: transparent; border-botto=
m-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0=
px; border-image-outset: 0; border-image-repeat: stretch; border-image-slic=
e: 100%; border-image-source: none; border-image-width: 1; border-left-colo=
r: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border=
-right-color: rgb(34, 34, 34); border-right-style: none; border-right-width=
: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-to=
p-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-fa=
mily: arial,sans-serif; font-size: 13px; font-style: normal; font-variant: =
normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margi=
n-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom=
: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align:=
left; text-decoration: none; text-indent: 0px; text-transform: none; -webk=
it-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">observe=
r_ptr (in debug/analyze mode) and solve all cases of lifetime monitoring (u=
nder the said limitations) - from smart pointers to function_view?</span></=
span></font></div><div><span style=3D"display: inline !important; float: no=
ne; background-color: transparent; color: rgb(34, 34, 34); font-family: cou=
rier new; font-size: 13px; font-style: normal; font-variant: normal; font-w=
eight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-deco=
ration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-w=
idth: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"arial,san=
s-serif"><b><i><br></i></b></font></span></div><div><font face=3D"arial,san=
s-serif"><br></font></div><div><i><br></i></div><blockquote class=3D"gmail_=
quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pa=
dding-left: 1ex;"><div dir=3D"ltr"><div></div></div></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/a395ffbf-fc53-4288-b1ca-f559e1703eac%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a395ffbf-fc53-4288-b1ca-f559e1703eac=
%40isocpp.org</a>.<br />
------=_Part_5867_532900526.1516365052740--
------=_Part_5866_1096684638.1516365052739--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Fri, 19 Jan 2018 12:19:40 -0800 (PST)
Raw View
------=_Part_131_465122146.1516393180381
Content-Type: multipart/alternative;
boundary="----=_Part_132_1567762127.1516393180381"
------=_Part_132_1567762127.1516393180381
Content-Type: text/plain; charset="UTF-8"
On Friday, January 19, 2018 at 7:30:52 AM UTC-5, mihailn...@gmail.com wrote:
>
> Can we "just" define special behavior of observer_ptr (in debug/analyze
> mode) and solve all cases of lifetime monitoring (under the said
> limitations) - from smart pointers to function_view?
>
That's not "behavior" of the type. There is no actual code in
`observer_ptr` that does anything you're talking about. It's simply a
compiler or tool that sees you using this particular type and starts
looking at things because of it.
It should also be noted that this still doesn't handle perfect forwarding.
Not unless it is the caller of the function who wraps the parameter in an
`observer_ptr`.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/88864914-82a8-4a8b-bda7-cffd38379edf%40isocpp.org.
------=_Part_132_1567762127.1516393180381
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Friday, January 19, 2018 at 7:30:52 AM UTC-5, mihailn..=
..@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr"><div><font face=3D"arial,sans-serif"><span style=3D"text-align:left;co=
lor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal=
;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-=
decoration:none;word-spacing:0px;display:inline!important;white-space:norma=
l;float:none;background-color:transparent">Can we <span style=3D"display:in=
line!important;float:none;background-color:transparent;color:rgb(34,34,34);=
font-family:arial,sans-serif;font-size:13px;font-style:normal;font-variant:=
normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoratio=
n:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:=
0px">"just" </span>define special behavior of=C2=A0<span style=3D=
"background-color:transparent;border-bottom-color:rgb(34,34,34);border-bott=
om-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);borde=
r-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,34);bo=
rder-right-style:none;border-right-width:0px;border-top-color:rgb(34,34,34)=
;border-top-style:none;border-top-width:0px;color:rgb(34,34,34);display:inl=
ine;float:none;font-family:arial,sans-serif;font-size:13px;font-style:norma=
l;font-variant:normal;font-weight:400;letter-spacing:normal;margin-bottom:0=
px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;paddi=
ng-left:0px;padding-right:0px;padding-top:0px;text-align:left;text-decorati=
on:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing=
:0px">observer_ptr (in debug/analyze mode) and solve all cases of lifetime =
monitoring (under the said limitations) - from smart pointers to function_v=
iew?</span></span></font></div></div></blockquote><div><br></div><div>That&=
#39;s not "behavior" of the type. There is no actual code in `obs=
erver_ptr` that does anything you're talking about. It's simply a c=
ompiler or tool that sees you using this particular type and starts looking=
at things because of it.</div><div><br></div><div>It should also be noted =
that this still doesn't handle perfect forwarding. Not unless it is the=
caller of the function who wraps the parameter in an `observer_ptr`.</div>=
</div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/88864914-82a8-4a8b-bda7-cffd38379edf%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/88864914-82a8-4a8b-bda7-cffd38379edf=
%40isocpp.org</a>.<br />
------=_Part_132_1567762127.1516393180381--
------=_Part_131_465122146.1516393180381--
.
Author: mihailnajdenov@gmail.com
Date: Sat, 20 Jan 2018 03:12:09 -0800 (PST)
Raw View
------=_Part_1839_156315941.1516446729100
Content-Type: multipart/alternative;
boundary="----=_Part_1840_749971179.1516446729101"
------=_Part_1840_749971179.1516446729101
Content-Type: text/plain; charset="UTF-8"
On Friday, January 19, 2018 at 10:19:40 PM UTC+2, Nicol Bolas wrote:
>
> On Friday, January 19, 2018 at 7:30:52 AM UTC-5, mihailn...@gmail.com
> wrote:
>>
>> Can we "just" define special behavior of observer_ptr (in debug/analyze
>> mode) and solve all cases of lifetime monitoring (under the said
>> limitations) - from smart pointers to function_view?
>>
>
> That's not "behavior" of the type. There is no actual code in
> `observer_ptr` that does anything you're talking about. It's simply a
> compiler or tool that sees you using this particular type and starts
> looking at things because of it.
>
If the constructor and reset of observer_ptr are decorated with something
like [[debug:observe_destruction]] the behavior of observer_ptr will be
enforced by the compiler.
The behavior, use and definition of observer_ptr are not changed.
>
> It should also be noted that this still doesn't handle perfect forwarding.
> Not unless it is the caller of the function who wraps the parameter in an
> `observer_ptr`.
>
class A_view
{
A_view(const A* pa) : _p(pa) {}
A_view(const A& a) : _p(&a) {}
A_view(A&& a) : _p(&a) {}
observer_ptr<const A> _p;
};
observer_ptr will monitor addressof(*_p) for ~A() call. The scope of
monitoring is ~observer_ptr() or release() call.
Copies of observer_ptr still monitor the same address, but with a different
scope - their dtor, release or reset.
That is a major difference from lifetime extension - we can have
many-to-one mapping without any semantic or implementation problems. Lifetime
extension does not allow copies of a view/ref to extend with the lifetime
of the object.
We are also not limited to initialization only - the monitoring can
(re)start at the call of reset() instead on constructor call only. Lifetime
extension deals with initialization exclusively.
How can perfect forwarding interfere in all this?
template<typename T, typename ...Args>
auto init(Args&&... arg)
{
return T(std::forward<Args>(arg)...); //< observer_ptr starts monitoring
&arg
}
int main()
{
auto v = init<A_view>(A{}); //< both A_view and A allocated. A_view
usable before the ';' when ~A is called
}
If copy elision does not kick-in nothing changes - copy is safe and
defined, lifetime of A is the same.
If we pass arguments and create A in init() instead ( return T(A(std::forward<Args>(arg)...));
), then the observer_ptr is still created with a valid address,
however, after we return will not be able to use A_view in any way,
including before the ';'.
If both there is no elision and A is created when initializing T inside
init, then the returned view can be created from a dangling view.
We could allow views from dangling views to be created, however no dtor
will be monitored and all uses of the view will be illegal until
destroyed/reset/release-ed.
We could also issue a warning on coping from dangling view without problem.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0%40isocpp.org.
------=_Part_1840_749971179.1516446729101
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Friday, January 19, 2018 at 10:19:40 PM UTC+2, =
Nicol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr">On Friday, January 19, 2018 at 7:30:52 AM UTC-5, <a>mihailn...@gmail.c=
om</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-lef=
t:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>=
<font face=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb(34=
,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-size=
:13px;font-style:normal;font-variant:normal;font-weight:400;text-decoration=
:none;word-spacing:0px;display:inline!important;white-space:normal;float:no=
ne;background-color:transparent">Can we <span style=3D"display:inline!impor=
tant;float:none;background-color:transparent;color:rgb(34,34,34);font-famil=
y:arial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;fon=
t-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;tex=
t-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">"=
;just" </span>define special behavior of=C2=A0<span style=3D"backgroun=
d-color:transparent;border-bottom-color:rgb(34,34,34);border-bottom-style:n=
one;border-bottom-width:0px;border-left-color:rgb(34,34,34);border-left-sty=
le:none;border-left-width:0px;border-right-color:rgb(34,34,34);border-right=
-style:none;border-right-width:0px;border-top-color:rgb(34,34,34);border-to=
p-style:none;border-top-width:0px;color:rgb(34,34,34);display:inline;float:=
none;font-family:arial,sans-serif;font-size:13px;font-style:normal;font-var=
iant:normal;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-=
left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0p=
x;padding-right:0px;padding-top:0px;text-align:left;text-decoration:none;te=
xt-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">obse=
rver_ptr (in debug/analyze mode) and solve all cases of lifetime monitoring=
(under the said limitations) - from smart pointers to function_view?</span=
></span></font></div></div></blockquote><div><br></div><div>That's not =
"behavior" of the type. There is no actual code in `observer_ptr`=
that does anything you're talking about. It's simply a compiler or=
tool that sees you using this particular type and starts looking at things=
because of it.</div></div></blockquote><div><br></div><div>If the construc=
tor and reset of <span style=3D"display: inline !important; float: none; ba=
ckground-color: transparent; color: rgb(34, 34, 34); font-family: "Ari=
al","Helvetica",sans-serif; font-size: 13px; font-style: nor=
mal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphan=
s: 2; text-align: left; text-decoration: none; text-indent: 0px; text-trans=
form: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spaci=
ng: 0px;">observer_ptr are decorated with something like<font face=3D"couri=
er new,monospace"> [[debug:observe_destruction]] </font>the=C2=A0<span styl=
e=3D"display: inline !important; float: none; background-color: transparent=
; color: rgb(34, 34, 34); font-family: "Arial","Helvetica&qu=
ot;,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; =
font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; tex=
t-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-st=
roke-width: 0px; white-space: normal; word-spacing: 0px;">behavior of=C2=A0=
<span style=3D"background-color: transparent; border-bottom-color: rgb(34, =
34, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-=
outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-i=
mage-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34=
); border-left-style: none; border-left-width: 0px; border-right-color: rgb=
(34, 34, 34); border-right-style: none; border-right-width: 0px; border-top=
-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; col=
or: rgb(34, 34, 34); display: inline; float: none; font-family: &quot;A=
rial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; f=
ont-style: normal; font-variant: normal; font-weight: 400; letter-spacing: =
normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top=
: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0=
px; padding-top: 0px; text-align: left; text-decoration: none; text-indent:=
0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: no=
rmal; word-spacing: 0px;">observer_ptr will be enforced by the compiler. </=
span></span></span></div><div><span style=3D"display: inline !important; fl=
oat: none; background-color: transparent; color: rgb(34, 34, 34); font-fami=
ly: "Arial","Helvetica",sans-serif; font-size: 13px; fo=
nt-style: normal; font-variant: normal; font-weight: 400; letter-spacing: n=
ormal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0p=
x; text-transform: none; -webkit-text-stroke-width: 0px; white-space: norma=
l; word-spacing: 0px;"><span style=3D"display: inline !important; float: no=
ne; background-color: transparent; color: rgb(34, 34, 34); font-family: &qu=
ot;Arial","Helvetica",sans-serif; font-size: 13px; font-styl=
e: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; =
orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text=
-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word=
-spacing: 0px;"><span style=3D"background-color: transparent; border-bottom=
-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0p=
x; border-image-outset: 0; border-image-repeat: stretch; border-image-slice=
: 100%; border-image-source: none; border-image-width: 1; border-left-color=
: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-=
right-color: rgb(34, 34, 34); border-right-style: none; border-right-width:=
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top=
-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-fam=
ily: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; fo=
nt-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; =
letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right:=
0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; =
padding-right: 0px; padding-top: 0px; text-align: left; text-decoration: no=
ne; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px;=
white-space: normal; word-spacing: 0px;"><br></span></span></span></div><d=
iv><span style=3D"display: inline !important; float: none; background-color=
: transparent; color: rgb(34, 34, 34); font-family: "Arial","=
;Helvetica",sans-serif; font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-ali=
gn: left; text-decoration: none; text-indent: 0px; text-transform: none; -w=
ebkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><spa=
n style=3D"display: inline !important; float: none; background-color: trans=
parent; color: rgb(34, 34, 34); font-family: "Arial","Helvet=
ica",sans-serif; font-size: 13px; font-style: normal; font-variant: no=
rmal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: lef=
t; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-t=
ext-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span style=
=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); display: inline; float: none; font-family: &quot;Arial&qu=
ot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: =
normal; font-variant: normal; font-weight: 400; letter-spacing: normal; mar=
gin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orph=
ans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding=
-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-=
transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-=
spacing: 0px;">The behavior, use and definition of observer_ptr are not cha=
nged. =C2=A0</span></span></span></div><div>=C2=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr"><div><br></div><div>It should =
also be noted that this still doesn't handle perfect forwarding. Not un=
less it is the caller of the function who wraps the parameter in an `observ=
er_ptr`.</div></div></blockquote><div><br></div><div><font face=3D"courier =
new,monospace">class A_view</font></div><div><font face=3D"courier new,mono=
space">{</font></div><div><font face=3D"courier new,monospace">=C2=A0 </fon=
t><font face=3D"courier new,monospace"><span style=3D"text-align: left; col=
or: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing=
: normal; font-size: 13px; font-style: normal; font-variant: normal; font-w=
eight: 400; text-decoration: none; word-spacing: 0px; display: inline !impo=
rtant; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-wi=
dth: 0px; background-color: transparent;">A_view(const A* pa) : _p(pa) {}</=
span></font></div><div><font face=3D"courier new,monospace">=C2=A0 <span st=
yle=3D"text-align: left; color: rgb(34, 34, 34); text-transform: none; text=
-indent: 0px; letter-spacing: normal; font-size: 13px; font-style: normal; =
font-variant: normal; font-weight: 400; text-decoration: none; word-spacing=
: 0px; display: inline !important; white-space: normal; orphans: 2; float: =
none; -webkit-text-stroke-width: 0px; background-color: transparent;"><span=
style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 3=
4); border-bottom-style: none; border-bottom-width: 0px; border-image-outse=
t: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-=
source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); bo=
rder-left-style: none; border-left-width: 0px; border-right-color: rgb(34, =
34, 34); border-right-style: none; border-right-width: 0px; border-top-colo=
r: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: r=
gb(34, 34, 34); display: inline; float: none; font-family: &quot;Arial&=
amp;quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-s=
tyle: normal; font-variant: normal; font-weight: 400; letter-spacing: norma=
l; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px=
; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; p=
adding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px;=
text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal;=
word-spacing: 0px;">A_view(const A& a) : _p(&a) {}</span></span></=
font></div><div><font face=3D"courier new,monospace">=C2=A0 <span style=3D"=
text-align: left; color: rgb(34, 34, 34); text-transform: none; text-indent=
: 0px; letter-spacing: normal; font-size: 13px; font-variant: normal; word-=
spacing: 0px; display: inline !important; white-space: normal; orphans: 2; =
float: none; -webkit-text-stroke-width: 0px; background-color: transparent;=
"><span style=3D"margin: 0px; padding: 0px; border: 0px rgb(34, 34, 34); bo=
rder-image: none; text-align: left; color: rgb(34, 34, 34); text-transform:=
none; text-indent: 0px; letter-spacing: normal; font-size: 13px; font-vari=
ant: normal; word-spacing: 0px; display: inline; white-space: normal; orpha=
ns: 2; float: none; -webkit-text-stroke-width: 0px; background-color: trans=
parent;"><span style=3D"background-color: transparent; border-bottom-color:=
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bord=
er-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%;=
border-image-source: none; border-image-width: 1; border-left-color: rgb(3=
4, 34, 34); border-left-style: none; border-left-width: 0px; border-right-c=
olor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; b=
order-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width:=
0px; color: rgb(34, 34, 34); display: inline; float: none; font-family: &a=
mp;quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size=
: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-=
spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; m=
argin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding=
-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; tex=
t-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-=
space: normal; word-spacing: 0px;">A_view(A&& a) : _p(&a) {}</s=
pan></span></span></font></div><div><span style=3D"text-align: left; color:=
rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing: n=
ormal; font-size: 13px; font-variant: normal; word-spacing: 0px; display: i=
nline !important; white-space: normal; orphans: 2; float: none; -webkit-tex=
t-stroke-width: 0px; background-color: transparent;"><span style=3D"margin:=
0px; padding: 0px; border: 0px rgb(34, 34, 34); border-image: none; text-a=
lign: left; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px;=
letter-spacing: normal; font-size: 13px; font-variant: normal; word-spacin=
g: 0px; display: inline; white-space: normal; orphans: 2; float: none; -web=
kit-text-stroke-width: 0px; background-color: transparent;"><span style=3D"=
background-color: transparent; border-bottom-color: rgb(34, 34, 34); border=
-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bord=
er-image-repeat: stretch; border-image-slice: 100%; border-image-source: no=
ne; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-=
style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); b=
order-right-style: none; border-right-width: 0px; border-top-color: rgb(34,=
34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34,=
34); display: inline; float: none; font-family: &quot;Arial&quot;,=
&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: norm=
al; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-=
bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans:=
2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top=
: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-tran=
sform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spac=
ing: 0px;"><font face=3D"courier new,monospace"><br></font></span></span></=
span></div><div><font face=3D"courier new,monospace">=C2=A0 <span style=3D"=
text-align: left; color: rgb(34, 34, 34); text-transform: none; text-indent=
: 0px; letter-spacing: normal; font-size: 13px; font-variant: normal; word-=
spacing: 0px; display: inline !important; white-space: normal; orphans: 2; =
float: none; -webkit-text-stroke-width: 0px; background-color: transparent;=
"><span style=3D"margin: 0px; padding: 0px; border: 0px rgb(34, 34, 34); bo=
rder-image: none; text-align: left; color: rgb(34, 34, 34); text-transform:=
none; text-indent: 0px; letter-spacing: normal; font-size: 13px; font-vari=
ant: normal; word-spacing: 0px; display: inline; white-space: normal; orpha=
ns: 2; float: none; -webkit-text-stroke-width: 0px; background-color: trans=
parent;"><span style=3D"background-color: transparent; border-bottom-color:=
rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bord=
er-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%;=
border-image-source: none; border-image-width: 1; border-left-color: rgb(3=
4, 34, 34); border-left-style: none; border-left-width: 0px; border-right-c=
olor: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; b=
order-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width:=
0px; color: rgb(34, 34, 34); display: inline; float: none; font-family: &a=
mp;quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size=
: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-=
spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; m=
argin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding=
-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; tex=
t-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-=
space: normal; word-spacing: 0px;">observer_ptr<const A> _p;</span><b=
></b></span></span></font></div><div><font face=3D"courier new,monospace">}=
;=C2=A0</font></div><div><font face=3D"courier new"><br></font></div><div><=
font face=3D"arial,sans-serif">observer_ptr will monitor addressof(*_p) for=
~A() call. The scope of monitoring is ~<span style=3D"text-align: left; co=
lor: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacin=
g: normal; font-size: 13px; font-style: normal; font-variant: normal; font-=
weight: 400; text-decoration: none; word-spacing: 0px; display: inline !imp=
ortant; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-w=
idth: 0px; background-color: transparent;">observer_ptr() or release() call=
..</span></font></div><div><font face=3D"arial,sans-serif"><span style=3D"te=
xt-align: left; color: rgb(34, 34, 34); text-transform: none; text-indent: =
0px; letter-spacing: normal; font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; text-decoration: none; word-spacing: 0px; di=
splay: inline !important; white-space: normal; orphans: 2; float: none; -we=
bkit-text-stroke-width: 0px; background-color: transparent;"><br></span></f=
ont></div><div><font face=3D"arial,sans-serif"><span style=3D"text-align: l=
eft; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter=
-spacing: normal; font-size: 13px; font-style: normal; font-variant: normal=
; font-weight: 400; text-decoration: none; word-spacing: 0px; display: inli=
ne !important; white-space: normal; orphans: 2; float: none; -webkit-text-s=
troke-width: 0px; background-color: transparent;">Copies of=C2=A0<span styl=
e=3D"margin: 0px; padding: 0px; border: 0px rgb(34, 34, 34); border-image: =
none; text-align: left; color: rgb(34, 34, 34); text-transform: none; text-=
indent: 0px; letter-spacing: normal; font-size: 13px; font-style: normal; f=
ont-variant: normal; font-weight: 400; text-decoration: none; word-spacing:=
0px; display: inline; white-space: normal; orphans: 2; float: none; -webki=
t-text-stroke-width: 0px; background-color: transparent;"><span style=3D"ba=
ckground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-b=
ottom-style: none; border-bottom-width: 0px; border-image-outset: 0; border=
-image-repeat: stretch; border-image-slice: 100%; border-image-source: none=
; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-st=
yle: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bor=
der-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 3=
4, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 3=
4); display: inline; float: none; font-size: 13px; font-style: normal; font=
-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: =
0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padd=
ing-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; t=
ext-align: left; text-decoration: none; text-indent: 0px; text-transform: n=
one; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px=
;"><span style=3D"background-color: transparent; border-bottom-color: rgb(3=
4, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-ima=
ge-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; borde=
r-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34,=
34); border-left-style: none; border-left-width: 0px; border-right-color: =
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-=
top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; =
color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font=
-style: normal; font-variant: normal; font-weight: 400; letter-spacing: nor=
mal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0=
px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;=
padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0p=
x; text-transform: none; -webkit-text-stroke-width: 0px; white-space: norma=
l; word-spacing: 0px;"><font face=3D"arial,sans-serif">observer_ptr still m=
onitor the same address, but with a different scope - their dtor, release o=
r reset.</font></span></span></span></span></font><font face=3D"arial,sans-=
serif"><span style=3D"text-align: left; color: rgb(34, 34, 34); text-transf=
orm: none; text-indent: 0px; letter-spacing: normal; font-size: 13px; font-=
style: normal; font-variant: normal; font-weight: 400; text-decoration: non=
e; word-spacing: 0px; display: inline !important; white-space: normal; orph=
ans: 2; float: none; -webkit-text-stroke-width: 0px; background-color: tran=
sparent;"><span style=3D"margin: 0px; padding: 0px; border: 0px rgb(34, 34,=
34); border-image: none; text-align: left; color: rgb(34, 34, 34); text-tr=
ansform: none; text-indent: 0px; letter-spacing: normal; font-size: 13px; f=
ont-style: normal; font-variant: normal; font-weight: 400; text-decoration:=
none; word-spacing: 0px; display: inline; white-space: normal; orphans: 2;=
float: none; -webkit-text-stroke-width: 0px; background-color: transparent=
;"><span style=3D"background-color: transparent; border-bottom-color: rgb(3=
4, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-ima=
ge-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; borde=
r-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34,=
34); border-left-style: none; border-left-width: 0px; border-right-color: =
rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-=
top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; =
color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font=
-style: normal; font-variant: normal; font-weight: 400; letter-spacing: nor=
mal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0=
px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;=
padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0p=
x; text-transform: none; -webkit-text-stroke-width: 0px; white-space: norma=
l; word-spacing: 0px;"><span style=3D"background-color: transparent; border=
-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-wi=
dth: 0px; border-image-outset: 0; border-image-repeat: stretch; border-imag=
e-slice: 100%; border-image-source: none; border-image-width: 1; border-lef=
t-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; =
border-right-color: rgb(34, 34, 34); border-right-style: none; border-right=
-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bor=
der-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; f=
ont-size: 13px; font-style: normal; font-variant: normal; font-weight: 400;=
letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right=
: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px;=
padding-right: 0px; padding-top: 0px; text-align: left; text-decoration: n=
one; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px=
; white-space: normal; word-spacing: 0px;"></span></span></span></span></fo=
nt></div><div><font face=3D"arial,sans-serif"><span style=3D"text-align: le=
ft; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-=
spacing: normal; font-size: 13px; font-style: normal; font-variant: normal;=
font-weight: 400; text-decoration: none; word-spacing: 0px; display: inlin=
e !important; white-space: normal; orphans: 2; float: none; -webkit-text-st=
roke-width: 0px; background-color: transparent;"><span style=3D"margin: 0px=
; padding: 0px; border: 0px rgb(34, 34, 34); border-image: none; text-align=
: left; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; let=
ter-spacing: normal; font-size: 13px; font-style: normal; font-variant: nor=
mal; font-weight: 400; text-decoration: none; word-spacing: 0px; display: i=
nline; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-wi=
dth: 0px; background-color: transparent;"><span style=3D"background-color: =
transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: non=
e; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: s=
tretch; border-image-slice: 100%; border-image-source: none; border-image-w=
idth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; borde=
r-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style:=
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-t=
op-style: none; border-top-width: 0px; color: rgb(34, 34, 34); display: inl=
ine; float: none; font-size: 13px; font-style: normal; font-variant: normal=
; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left=
: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px;=
padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;=
text-decoration: none; text-indent: 0px; text-transform: none; -webkit-tex=
t-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><span style=
=3D"background-color: transparent; border-bottom-color: rgb(34, 34, 34); bo=
rder-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; =
border-image-repeat: stretch; border-image-slice: 100%; border-image-source=
: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-l=
eft-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34=
); border-right-style: none; border-right-width: 0px; border-top-color: rgb=
(34, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34,=
34, 34); display: inline; float: none; font-size: 13px; font-style: normal=
; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bo=
ttom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2=
; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: =
0px; text-align: left; text-decoration: none; text-indent: 0px; text-transf=
orm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacin=
g: 0px;"><br></span></span></span></span></font></div><font face=3D"arial,s=
ans-serif"><span style=3D"text-align: left; color: rgb(34, 34, 34); text-tr=
ansform: none; text-indent: 0px; letter-spacing: normal; font-size: 13px; f=
ont-style: normal; font-variant: normal; font-weight: 400; text-decoration:=
none; word-spacing: 0px; display: inline !important; white-space: normal; =
orphans: 2; float: none; -webkit-text-stroke-width: 0px; background-color: =
transparent;"><span style=3D"margin: 0px; padding: 0px; border: 0px rgb(34,=
34, 34); border-image: none; text-align: left; color: rgb(34, 34, 34); tex=
t-transform: none; text-indent: 0px; letter-spacing: normal; font-size: 13p=
x; font-style: normal; font-variant: normal; font-weight: 400; text-decorat=
ion: none; word-spacing: 0px; display: inline; white-space: normal; orphans=
: 2; float: none; -webkit-text-stroke-width: 0px; background-color: transpa=
rent;"><span style=3D"background-color: transparent; border-bottom-color: r=
gb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border=
-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; b=
order-image-source: none; border-image-width: 1; border-left-color: rgb(34,=
34, 34); border-left-style: none; border-left-width: 0px; border-right-col=
or: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; bor=
der-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0=
px; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; =
font-style: normal; font-variant: normal; font-weight: 400; letter-spacing:=
normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-to=
p: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: =
0px; padding-top: 0px; text-align: left; text-decoration: none; text-indent=
: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: n=
ormal; word-spacing: 0px;"><span style=3D"background-color: transparent; bo=
rder-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-botto=
m-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-=
image-slice: 100%; border-image-source: none; border-image-width: 1; border=
-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0=
px; border-right-color: rgb(34, 34, 34); border-right-style: none; border-r=
ight-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none;=
border-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: non=
e; font-size: 13px; font-style: normal; font-variant: normal; font-weight: =
400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-r=
ight: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: =
0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decoratio=
n: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width:=
0px; white-space: normal; word-spacing: 0px;"><div><br></div></span></span=
></span></span></font><div><font face=3D"arial,sans-serif"><span style=3D"t=
ext-align: left; color: rgb(34, 34, 34); text-transform: none; text-indent:=
0px; letter-spacing: normal; font-size: 13px; font-style: normal; font-var=
iant: normal; font-weight: 400; text-decoration: none; word-spacing: 0px; d=
isplay: inline !important; white-space: normal; orphans: 2; float: none; -w=
ebkit-text-stroke-width: 0px; background-color: transparent;"><span style=
=3D"margin: 0px; padding: 0px; border: 0px rgb(34, 34, 34); border-image: n=
one; text-align: left; color: rgb(34, 34, 34); text-transform: none; text-i=
ndent: 0px; letter-spacing: normal; font-size: 13px; font-style: normal; fo=
nt-variant: normal; font-weight: 400; text-decoration: none; word-spacing: =
0px; display: inline; white-space: normal; orphans: 2; float: none; -webkit=
-text-stroke-width: 0px; background-color: transparent;"><span style=3D"bac=
kground-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bo=
ttom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-=
image-repeat: stretch; border-image-slice: 100%; border-image-source: none;=
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-sty=
le: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bord=
er-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34=
, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34=
); display: inline; float: none; font-size: 13px; font-style: normal; font-=
variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0=
px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; paddi=
ng-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; te=
xt-align: left; text-decoration: none; text-indent: 0px; text-transform: no=
ne; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;=
"><span style=3D"background-color: transparent; border-bottom-color: rgb(34=
, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-imag=
e-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border=
-image-source: none; border-image-width: 1; border-left-color: rgb(34, 34, =
34); border-left-style: none; border-left-width: 0px; border-right-color: r=
gb(34, 34, 34); border-right-style: none; border-right-width: 0px; border-t=
op-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; c=
olor: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-=
style: normal; font-variant: normal; font-weight: 400; letter-spacing: norm=
al; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0p=
x; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; =
padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px=
; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal=
; word-spacing: 0px;">That is a major difference from lifetime extension - =
we can have many-to-one mapping without any semantic or implementation prob=
lems.=C2=A0<span style=3D"display: inline !important; float: none; backgrou=
nd-color: transparent; color: rgb(34, 34, 34); font-family: arial,sans-seri=
f; font-size: 13px; font-style: normal; font-variant: normal; font-weight: =
400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration:=
none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0=
px; white-space: normal; word-spacing: 0px;">Lifetime extension does not al=
low copies of a view/ref to extend with the lifetime of the object.</span><=
/span></span></span></span></font></div><div><font face=3D"arial,sans-serif=
"><span style=3D"text-align: left; color: rgb(34, 34, 34); text-transform: =
none; text-indent: 0px; letter-spacing: normal; font-size: 13px; font-style=
: normal; font-variant: normal; font-weight: 400; text-decoration: none; wo=
rd-spacing: 0px; display: inline !important; white-space: normal; orphans: =
2; float: none; -webkit-text-stroke-width: 0px; background-color: transpare=
nt;"><span style=3D"margin: 0px; padding: 0px; border: 0px rgb(34, 34, 34);=
border-image: none; text-align: left; color: rgb(34, 34, 34); text-transfo=
rm: none; text-indent: 0px; letter-spacing: normal; font-size: 13px; font-s=
tyle: normal; font-variant: normal; font-weight: 400; text-decoration: none=
; word-spacing: 0px; display: inline; white-space: normal; orphans: 2; floa=
t: none; -webkit-text-stroke-width: 0px; background-color: transparent;"><s=
pan style=3D"background-color: transparent; border-bottom-color: rgb(34, 34=
, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-ou=
tset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-ima=
ge-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34);=
border-left-style: none; border-left-width: 0px; border-right-color: rgb(3=
4, 34, 34); border-right-style: none; border-right-width: 0px; border-top-c=
olor: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color=
: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-styl=
e: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; =
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; o=
rphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; te=
xt-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; wo=
rd-spacing: 0px;"><span style=3D"background-color: transparent; border-bott=
om-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: =
0px; border-image-outset: 0; border-image-repeat: stretch; border-image-sli=
ce: 100%; border-image-source: none; border-image-width: 1; border-left-col=
or: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; borde=
r-right-color: rgb(34, 34, 34); border-right-style: none; border-right-widt=
h: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-t=
op-width: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-s=
ize: 13px; font-style: normal; font-variant: normal; font-weight: 400; lett=
er-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px=
; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; =
text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whi=
te-space: normal; word-spacing: 0px;">We are also not limited to initializa=
tion only - the monitoring can (re)start at the call of reset() instead on =
constructor call only. Lifetime extension deals with initialization exclusi=
vely.=C2=A0</span></span></span></span></font></div><div><font face=3D"aria=
l,sans-serif"><span style=3D"text-align: left; color: rgb(34, 34, 34); text=
-transform: none; text-indent: 0px; letter-spacing: normal; font-size: 13px=
; font-style: normal; font-variant: normal; font-weight: 400; text-decorati=
on: none; word-spacing: 0px; display: inline !important; white-space: norma=
l; orphans: 2; float: none; -webkit-text-stroke-width: 0px; background-colo=
r: transparent;"><span style=3D"margin: 0px; padding: 0px; border: 0px rgb(=
34, 34, 34); border-image: none; text-align: left; color: rgb(34, 34, 34); =
text-transform: none; text-indent: 0px; letter-spacing: normal; font-size: =
13px; font-style: normal; font-variant: normal; font-weight: 400; text-deco=
ration: none; word-spacing: 0px; display: inline; white-space: normal; orph=
ans: 2; float: none; -webkit-text-stroke-width: 0px; background-color: tran=
sparent;"><span style=3D"background-color: transparent; border-bottom-color=
: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; bor=
der-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%=
; border-image-source: none; border-image-width: 1; border-left-color: rgb(=
34, 34, 34); border-left-style: none; border-left-width: 0px; border-right-=
color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; =
border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width=
: 0px; color: rgb(34, 34, 34); display: inline; float: none; font-size: 13p=
x; font-style: normal; font-variant: normal; font-weight: 400; letter-spaci=
ng: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin=
-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-righ=
t: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-ind=
ent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space=
: normal; word-spacing: 0px;"><span style=3D"background-color: transparent;=
border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bo=
ttom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; bord=
er-image-slice: 100%; border-image-source: none; border-image-width: 1; bor=
der-left-color: rgb(34, 34, 34); border-left-style: none; border-left-width=
: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; borde=
r-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: no=
ne; border-top-width: 0px; color: rgb(34, 34, 34); display: inline; float: =
none; font-size: 13px; font-style: normal; font-variant: normal; font-weigh=
t: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margi=
n-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-lef=
t: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-decora=
tion: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-wid=
th: 0px; white-space: normal; word-spacing: 0px;"><br></span></span></span>=
</span></font></div><div><font face=3D"arial,sans-serif"><span style=3D"tex=
t-align: left; color: rgb(34, 34, 34); text-transform: none; text-indent: 0=
px; letter-spacing: normal; font-size: 13px; font-style: normal; font-varia=
nt: normal; font-weight: 400; text-decoration: none; word-spacing: 0px; dis=
play: inline !important; white-space: normal; orphans: 2; float: none; -web=
kit-text-stroke-width: 0px; background-color: transparent;"><span style=3D"=
margin: 0px; padding: 0px; border: 0px rgb(34, 34, 34); border-image: none;=
text-align: left; color: rgb(34, 34, 34); text-transform: none; text-inden=
t: 0px; letter-spacing: normal; font-size: 13px; font-style: normal; font-v=
ariant: normal; font-weight: 400; text-decoration: none; word-spacing: 0px;=
display: inline; white-space: normal; orphans: 2; float: none; -webkit-tex=
t-stroke-width: 0px; background-color: transparent;"><span style=3D"backgro=
und-color: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom=
-style: none; border-bottom-width: 0px; border-image-outset: 0; border-imag=
e-repeat: stretch; border-image-slice: 100%; border-image-source: none; bor=
der-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: =
none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-r=
ight-style: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34=
); border-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); d=
isplay: inline; float: none; font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; =
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-a=
lign: left; text-decoration: none; text-indent: 0px; text-transform: none; =
-webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><s=
pan style=3D"background-color: transparent; border-bottom-color: rgb(34, 34=
, 34); border-bottom-style: none; border-bottom-width: 0px; border-image-ou=
tset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-ima=
ge-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34);=
border-left-style: none; border-left-width: 0px; border-right-color: rgb(3=
4, 34, 34); border-right-style: none; border-right-width: 0px; border-top-c=
olor: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color=
: rgb(34, 34, 34); display: inline; float: none; font-size: 13px; font-styl=
e: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; =
margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; o=
rphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padd=
ing-top: 0px; text-align: left; text-decoration: none; text-indent: 0px; te=
xt-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; wo=
rd-spacing: 0px;"><br></span></span></span></span></font></div><div>How can=
perfect forwarding interfere in all this?=C2=A0</div><div><br></div><div><=
br></div><div><font face=3D"courier new,monospace">template<typename T, =
typename ...Args><br>auto init(Args&&... arg)<br>{<br>=C2=A0 ret=
urn T(std::forward<Args>(arg)...); //< observer_ptr starts monitor=
ing &arg<br>}<br><br>int main()<br>{ <br>=C2=A0 auto v =3D init<A_vi=
ew>(A{}); //< both A_view and A allocated. A_view usable before the &=
#39;;' when ~A is called<br>}</font></div><div><font face=3D"courier ne=
w"><br></font></div><div>If copy elision does not kick-in nothing changes -=
copy is safe and defined, lifetime of A is the same.</div><div><br></div><=
div>If we pass arguments and create A in init() instead ( <font face=3D"cou=
rier new,monospace">return</font>=C2=A0 <span style=3D"display: inline !imp=
ortant; float: none; background-color: transparent; color: rgb(34, 34, 34);=
font-family: courier new,monospace; font-size: 13px; font-style: normal; f=
ont-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; =
text-align: left; text-decoration: none; text-indent: 0px; text-transform: =
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0p=
x;">T(A(std::forward<Args>(arg)...)); </span>), then the <font face=
=3D"courier new,monospace">observer_ptr </font>is still created with a vali=
d address, </div><div>however, after we return will not be able to use<font=
face=3D"courier new,monospace"> A_view</font> in any way, including before=
the <font face=3D"courier new,monospace">';'.=C2=A0</font></div><d=
iv><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><font face=
=3D"courier new,monospace"><br></font></div><div>If both there is no elisio=
n and A is created when initializing T inside init, then the returned view =
can be created from a dangling view.=C2=A0</div><div>We could allow views f=
rom dangling views to be created, however=C2=A0<span style=3D"display: inli=
ne !important; float: none; background-color: transparent; color: rgb(34, 3=
4, 34); font-family: "Arial","Helvetica",sans-serif; fo=
nt-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; =
letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none=
; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; w=
hite-space: normal; word-spacing: 0px;">no dtor will be monitored and</span=
> all uses of the view will be illegal until destroyed/reset/release-ed. </=
div><div>We could also issue a warning on coping from dangling view without=
problem.</div><div><br></div><div><br></div><div><br></div><div><font face=
=3D"arial,sans-serif"><b><i><br></i></b></font></div><div>=C2=A0</div></div=
>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0=
%40isocpp.org</a>.<br />
------=_Part_1840_749971179.1516446729101--
------=_Part_1839_156315941.1516446729100--
.
Author: Richard Hodges <hodges.r@gmail.com>
Date: Sat, 20 Jan 2018 15:54:50 +0100
Raw View
--001a114411780b9ee7056336617d
Content-Type: text/plain; charset="UTF-8"
> Copies of observer_ptr still monitor the same address, but with a
different scope - their dtor, release or reset.
It would be nice if this were enough.
consider
auto& exec = some_async_executor();
auto up = std::make_unique<Foo>();
auto p = observer_ptr(up.get());
exec.post([p] { something_with(*p); }); // A
exec.post([up = std::move(up)] { something_with(*up); }); // B
exec.post([p] { something_with(*p); }); // C
Assume that B's lambda invocation may or may not complete before C's lambda
invocation.
I can't see how this could be statically analysed. It's an undetectable
logic error, since as far as the compiler is concerned, it has no way of
knowing that C's p may outlive B's up.
Note that at the point of the construction of each of the 3 lambdas, the
pointers captured are all valid (except in the crossing case where there is
a context switch after the post at B).
On 20 January 2018 at 12:12, <mihailnajdenov@gmail.com> wrote:
>
>
> On Friday, January 19, 2018 at 10:19:40 PM UTC+2, Nicol Bolas wrote:
>>
>> On Friday, January 19, 2018 at 7:30:52 AM UTC-5, mihailn...@gmail.com
>> wrote:
>>>
>>> Can we "just" define special behavior of observer_ptr (in debug/analyze
>>> mode) and solve all cases of lifetime monitoring (under the said
>>> limitations) - from smart pointers to function_view?
>>>
>>
>> That's not "behavior" of the type. There is no actual code in
>> `observer_ptr` that does anything you're talking about. It's simply a
>> compiler or tool that sees you using this particular type and starts
>> looking at things because of it.
>>
>
> If the constructor and reset of observer_ptr are decorated with something
> like [[debug:observe_destruction]] the behavior of observer_ptr will be
> enforced by the compiler.
>
> The behavior, use and definition of observer_ptr are not changed.
>
>
>>
>> It should also be noted that this still doesn't handle perfect
>> forwarding. Not unless it is the caller of the function who wraps the
>> parameter in an `observer_ptr`.
>>
>
> class A_view
> {
> A_view(const A* pa) : _p(pa) {}
> A_view(const A& a) : _p(&a) {}
> A_view(A&& a) : _p(&a) {}
>
> observer_ptr<const A> _p;
> };
>
> observer_ptr will monitor addressof(*_p) for ~A() call. The scope of
> monitoring is ~observer_ptr() or release() call.
>
> Copies of observer_ptr still monitor the same address, but with a
> different scope - their dtor, release or reset.
>
>
> That is a major difference from lifetime extension - we can have
> many-to-one mapping without any semantic or implementation problems. Lifetime
> extension does not allow copies of a view/ref to extend with the lifetime
> of the object.
> We are also not limited to initialization only - the monitoring can
> (re)start at the call of reset() instead on constructor call only. Lifetime
> extension deals with initialization exclusively.
>
>
> How can perfect forwarding interfere in all this?
>
>
> template<typename T, typename ...Args>
> auto init(Args&&... arg)
> {
> return T(std::forward<Args>(arg)...); //< observer_ptr starts monitoring
> &arg
> }
>
> int main()
> {
> auto v = init<A_view>(A{}); //< both A_view and A allocated. A_view
> usable before the ';' when ~A is called
> }
>
> If copy elision does not kick-in nothing changes - copy is safe and
> defined, lifetime of A is the same.
>
> If we pass arguments and create A in init() instead ( return
> T(A(std::forward<Args>(arg)...)); ), then the observer_ptr is still
> created with a valid address,
> however, after we return will not be able to use A_view in any way,
> including before the ';'.
>
> If both there is no elision and A is created when initializing T inside
> init, then the returned view can be created from a dangling view.
> We could allow views from dangling views to be created, however no dtor
> will be monitored and all uses of the view will be illegal until
> destroyed/reset/release-ed.
> We could also issue a warning on coping from dangling view without problem.
>
>
>
>
>
>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-
> a65a-2ce3c10c60c0%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hYQHFXi5eRrcdCGEqWj-n4w4NKYDpRx4G_U16i%2B2VS5nQ%40mail.gmail.com.
--001a114411780b9ee7056336617d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">>=C2=A0<span style=3D"font-size:13px">Copies of=C2=A0</=
span><span style=3D"font-size:13px;font-variant-numeric:normal;font-variant=
-east-asian:normal;background-color:transparent;margin:0px;padding:0px;bord=
er:0px rgb(34,34,34)">observer_ptr still monitor the same address, but with=
a different scope - their dtor, release or reset.</span><div><span style=
=3D"font-size:13px;font-variant-numeric:normal;font-variant-east-asian:norm=
al;background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34=
,34)"><br></span></div><div><span style=3D"font-size:13px;font-variant-nume=
ric:normal;font-variant-east-asian:normal;background-color:transparent;marg=
in:0px;padding:0px;border:0px rgb(34,34,34)">It would be nice if this were =
enough.</span></div><div><span style=3D"font-size:13px;font-variant-numeric=
:normal;font-variant-east-asian:normal;background-color:transparent;margin:=
0px;padding:0px;border:0px rgb(34,34,34)"><br></span></div><div><span style=
=3D"font-size:13px;font-variant-numeric:normal;font-variant-east-asian:norm=
al;background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34=
,34)">consider</span></div><div><span style=3D"font-size:13px;font-variant-=
numeric:normal;font-variant-east-asian:normal;background-color:transparent;=
margin:0px;padding:0px;border:0px rgb(34,34,34)"><br></span></div><div><spa=
n style=3D"font-size:13px;font-variant-numeric:normal;font-variant-east-asi=
an:normal;background-color:transparent;margin:0px;padding:0px;border:0px rg=
b(34,34,34)"><font face=3D"monospace, monospace">auto& exec =3D some_as=
ync_executor();</font></span></div><div><span style=3D"font-size:13px;font-=
variant-numeric:normal;font-variant-east-asian:normal;background-color:tran=
sparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><font face=3D"mono=
space, monospace">auto up =3D std::make_unique<Foo>();</font></span><=
/div><div><span style=3D"font-size:13px;font-variant-numeric:normal;font-va=
riant-east-asian:normal;background-color:transparent;margin:0px;padding:0px=
;border:0px rgb(34,34,34)"><font face=3D"monospace, monospace"><br></font><=
/span></div><div><span style=3D"font-size:13px;font-variant-numeric:normal;=
font-variant-east-asian:normal;background-color:transparent;margin:0px;padd=
ing:0px;border:0px rgb(34,34,34)"><font face=3D"monospace, monospace">auto =
p =3D observer_ptr(up.get());</font></span></div><div><div><span style=3D"f=
ont-size:13px;font-variant-numeric:normal;font-variant-east-asian:normal;ba=
ckground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"=
><font face=3D"monospace, monospace">exec.post([p] { something_with(*p); })=
;=C2=A0 =C2=A0 // A</font></span></div></div><div><span style=3D"font-varia=
nt-numeric:normal;font-variant-east-asian:normal;background-color:transpare=
nt;margin:0px;padding:0px;border:0px rgb(34,34,34)"><div style=3D"font-size=
:small"><span style=3D"font-size:13px;font-variant-numeric:normal;font-vari=
ant-east-asian:normal;background-color:transparent;margin:0px;padding:0px;b=
order:0px rgb(34,34,34)"><font face=3D"monospace, monospace">exec.post([up =
=3D std::move(up)] { something_with(*up); }); // B</font></span></div><div>=
<span style=3D"font-variant-numeric:normal;font-variant-east-asian:normal;b=
ackground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)=
"><div style=3D"font-size:small"><span style=3D"font-size:13px;font-variant=
-numeric:normal;font-variant-east-asian:normal;background-color:transparent=
;margin:0px;padding:0px;border:0px rgb(34,34,34)"><font face=3D"monospace, =
monospace">exec.post([p] { something_with(*p); });=C2=A0 =C2=A0// C</font><=
/span></div><div style=3D"font-size:small"><span style=3D"font-size:13px;fo=
nt-variant-numeric:normal;font-variant-east-asian:normal;background-color:t=
ransparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><br></span></di=
v><div>Assume that B's lambda invocation may or may not complete before=
C's=C2=A0<span style=3D"background-color:transparent">lambda invocatio=
n</span><span style=3D"background-color:transparent">.</span></div><div sty=
le=3D"font-size:small"><span style=3D"font-size:13px;font-variant-numeric:n=
ormal;font-variant-east-asian:normal;background-color:transparent;margin:0p=
x;padding:0px;border:0px rgb(34,34,34)"><br></span></div><div style=3D"font=
-size:small"><span style=3D"font-size:13px;font-variant-numeric:normal;font=
-variant-east-asian:normal;background-color:transparent;margin:0px;padding:=
0px;border:0px rgb(34,34,34)">I can't see how this could be statically =
analysed. It's an undetectable logic error, since as far as the compile=
r is concerned, it has no way of knowing that C's <font face=3D"monospa=
ce, monospace">p</font> may outlive B's <font face=3D"monospace, monosp=
ace">up</font>.</span></div><div style=3D"font-size:small"><span style=3D"f=
ont-size:13px;font-variant-numeric:normal;font-variant-east-asian:normal;ba=
ckground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"=
><br></span></div><div style=3D"font-size:13px"><span style=3D"font-size:13=
px;font-variant-numeric:normal;font-variant-east-asian:normal;background-co=
lor:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)">Note that =
at the point of the construction of each of the 3 lambdas, the pointers cap=
tured are all valid (except in the crossing case where there is a context s=
witch after the post at B).</span></div><div style=3D"font-size:13px"><span=
style=3D"font-size:13px;font-variant-numeric:normal;font-variant-east-asia=
n:normal;background-color:transparent;margin:0px;padding:0px;border:0px rgb=
(34,34,34)"><br></span></div><div style=3D"font-size:13px"><span style=3D"f=
ont-size:13px;font-variant-numeric:normal;font-variant-east-asian:normal;ba=
ckground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"=
><br></span></div></span></div></span></div></div><div class=3D"gmail_extra=
"><br><div class=3D"gmail_quote">On 20 January 2018 at 12:12, <span dir=3D=
"ltr"><<a href=3D"mailto:mihailnajdenov@gmail.com" target=3D"_blank">mih=
ailnajdenov@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x"><div dir=3D"ltr"><span class=3D""><br><br>On Friday, January 19, 2018 at=
10:19:40 PM UTC+2, Nicol Bolas wrote:<blockquote class=3D"gmail_quote" sty=
le=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1e=
x"><div dir=3D"ltr">On Friday, January 19, 2018 at 7:30:52 AM UTC-5, <a>mih=
ailn...@gmail.com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr"><div><font face=3D"arial,sans-serif"><span style=3D"text-align:le=
ft;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:n=
ormal;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;=
text-decoration:none;word-spacing:0px;display:inline!important;white-space:=
normal;float:none;background-color:transparent">Can we <span style=3D"displ=
ay:inline!important;float:none;background-color:transparent;color:rgb(34,34=
,34);font-family:arial,sans-serif;font-size:13px;font-style:normal;font-var=
iant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-deco=
ration:none;text-indent:0px;text-transform:none;white-space:normal;word-spa=
cing:0px">"just" </span>define special behavior of=C2=A0<span sty=
le=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);border=
-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);=
border-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,3=
4);border-right-style:none;border-right-width:0px;border-top-color:rgb(34,3=
4,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);displa=
y:inline;float:none;font-family:arial,sans-serif;font-size:13px;font-style:=
normal;font-variant:normal;font-weight:400;letter-spacing:normal;margin-bot=
tom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;=
padding-left:0px;padding-right:0px;padding-top:0px;text-align:left;text-dec=
oration:none;text-indent:0px;text-transform:none;white-space:normal;word-sp=
acing:0px">observer_ptr (in debug/analyze mode) and solve all cases of life=
time monitoring (under the said limitations) - from smart pointers to funct=
ion_view?</span></span></font></div></div></blockquote><div><br></div><div>=
That's not "behavior" of the type. There is no actual code in=
`observer_ptr` that does anything you're talking about. It's simpl=
y a compiler or tool that sees you using this particular type and starts lo=
oking at things because of it.</div></div></blockquote><div><br></div></spa=
n><div>If the constructor and reset of <span style=3D"display:inline!import=
ant;float:none;background-color:transparent;color:rgb(34,34,34);font-family=
:"Arial","Helvetica",sans-serif;font-size:13px;font-sty=
le:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-al=
ign:left;text-decoration:none;text-indent:0px;text-transform:none;white-spa=
ce:normal;word-spacing:0px">observer_ptr are decorated with something like<=
font face=3D"courier new,monospace"> [[debug:observe_destruction]] </font>t=
he=C2=A0<span style=3D"display:inline!important;float:none;background-color=
:transparent;color:rgb(34,34,34);font-family:"Arial","Helvet=
ica",sans-serif;font-size:13px;font-style:normal;font-variant:normal;f=
ont-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;t=
ext-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">beh=
avior of=C2=A0<span>observer_ptr will be enforced by the compiler. </span><=
/span></span></div><div><span style=3D"display:inline!important;float:none;=
background-color:transparent;color:rgb(34,34,34);font-family:"Arial&qu=
ot;,"Helvetica",sans-serif;font-size:13px;font-style:normal;font-=
variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-d=
ecoration:none;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px"><span style=3D"display:inline!important;float:none;background-=
color:transparent;color:rgb(34,34,34);font-family:"Arial","H=
elvetica",sans-serif;font-size:13px;font-style:normal;font-variant:nor=
mal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:n=
one;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px=
"><span><br></span></span></span></div><div><span style=3D"display:inline!i=
mportant;float:none;background-color:transparent;color:rgb(34,34,34);font-f=
amily:"Arial","Helvetica",sans-serif;font-size:13px;fon=
t-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;te=
xt-align:left;text-decoration:none;text-indent:0px;text-transform:none;whit=
e-space:normal;word-spacing:0px"><span style=3D"display:inline!important;fl=
oat:none;background-color:transparent;color:rgb(34,34,34);font-family:"=
;Arial","Helvetica",sans-serif;font-size:13px;font-style:nor=
mal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:le=
ft;text-decoration:none;text-indent:0px;text-transform:none;white-space:nor=
mal;word-spacing:0px"><span>The behavior, use and definition of observer_pt=
r are not changed. =C2=A0</span></span></span></div><span class=3D""><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left=
:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><=
br></div><div>It should also be noted that this still doesn't handle pe=
rfect forwarding. Not unless it is the caller of the function who wraps the=
parameter in an `observer_ptr`.</div></div></blockquote><div><br></div></s=
pan><div><font face=3D"courier new,monospace">class A_view</font></div><div=
><font face=3D"courier new,monospace">{</font></div><div><font face=3D"cour=
ier new,monospace">=C2=A0 </font><font face=3D"courier new,monospace"><span=
style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-inde=
nt:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-variant:=
normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline=
!important;white-space:normal;float:none;background-color:transparent">A_vi=
ew(const A* pa) : _p(pa) {}</span></font></div><div><font face=3D"courier n=
ew,monospace">=C2=A0 <span style=3D"text-align:left;color:rgb(34,34,34);tex=
t-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-=
style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-=
spacing:0px;display:inline!important;white-space:normal;float:none;backgrou=
nd-color:transparent"><span>A_view(const A& a) : _p(&a) {}</span></=
span></font></div><div><font face=3D"courier new,monospace">=C2=A0 <span st=
yle=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:=
0px;letter-spacing:normal;font-size:13px;font-variant:normal;word-spacing:0=
px;display:inline!important;white-space:normal;float:none;background-color:=
transparent"><span style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34)=
;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;le=
tter-spacing:normal;font-size:13px;font-variant:normal;word-spacing:0px;dis=
play:inline;white-space:normal;float:none;background-color:transparent"><sp=
an>A_view(A&& a) : _p(&a) {}</span></span></span></font></div><=
div><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;=
text-indent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;wo=
rd-spacing:0px;display:inline!important;white-space:normal;float:none;backg=
round-color:transparent"><span style=3D"margin:0px;padding:0px;border:0px r=
gb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:none;text-i=
ndent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;word-spa=
cing:0px;display:inline;white-space:normal;float:none;background-color:tran=
sparent"><span><font face=3D"courier new,monospace"><br></font></span></spa=
n></span></div><div><font face=3D"courier new,monospace">=C2=A0 <span style=
=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px=
;letter-spacing:normal;font-size:13px;font-variant:normal;word-spacing:0px;=
display:inline!important;white-space:normal;float:none;background-color:tra=
nsparent"><span style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);te=
xt-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;lette=
r-spacing:normal;font-size:13px;font-variant:normal;word-spacing:0px;displa=
y:inline;white-space:normal;float:none;background-color:transparent"><span>=
observer_ptr<const A> _p;</span><b></b></span></span></font></div><di=
v><font face=3D"courier new,monospace">};=C2=A0</font></div><div><font face=
=3D"courier new"><br></font></div><div><font face=3D"arial,sans-serif">obse=
rver_ptr will monitor addressof(*_p) for ~A() call. The scope of monitoring=
is ~<span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none=
;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;fon=
t-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;disp=
lay:inline!important;white-space:normal;float:none;background-color:transpa=
rent">observer_ptr() or release() call.</span></font></div><div><font face=
=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb(34,34,34);te=
xt-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font=
-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word=
-spacing:0px;display:inline!important;white-space:normal;float:none;backgro=
und-color:transparent"><br></span></font></div><div><font face=3D"arial,san=
s-serif"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:=
none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal=
;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;=
display:inline!important;white-space:normal;float:none;background-color:tra=
nsparent">Copies of=C2=A0<span style=3D"margin:0px;padding:0px;border:0px r=
gb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:none;text-i=
ndent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-varia=
nt:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inl=
ine;white-space:normal;float:none;background-color:transparent"><span style=
=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);border-b=
ottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);bo=
rder-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,34)=
;border-right-style:none;border-right-width:0px;border-top-color:rgb(34,34,=
34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);display:=
inline;float:none;font-size:13px;font-style:normal;font-variant:normal;font=
-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin-=
right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right:=
0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px;te=
xt-transform:none;white-space:normal;word-spacing:0px"><span style=3D"backg=
round-color:transparent;border-bottom-color:rgb(34,34,34);border-bottom-sty=
le:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);border-left=
-style:none;border-left-width:0px;border-right-color:rgb(34,34,34);border-r=
ight-style:none;border-right-width:0px;border-top-color:rgb(34,34,34);borde=
r-top-style:none;border-top-width:0px;color:rgb(34,34,34);display:inline;fl=
oat:none;font-size:13px;font-style:normal;font-variant:normal;font-weight:4=
00;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin-right:0px=
;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;paddi=
ng-top:0px;text-align:left;text-decoration:none;text-indent:0px;text-transf=
orm:none;white-space:normal;word-spacing:0px"><font face=3D"arial,sans-seri=
f">observer_ptr still monitor the same address, but with a different scope =
- their dtor, release or reset.</font></span></span></span></span></font><f=
ont face=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb(34,3=
4,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-size:1=
3px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:n=
one;word-spacing:0px;display:inline!important;white-space:normal;float:none=
;background-color:transparent"><span style=3D"margin:0px;padding:0px;border=
:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:none;=
text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font=
-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;displ=
ay:inline;white-space:normal;float:none;background-color:transparent"><span=
style=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);bo=
rder-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,=
34);border-left-style:none;border-left-width:0px;border-right-color:rgb(34,=
34,34);border-right-style:none;border-right-width:0px;border-top-color:rgb(=
34,34,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);di=
splay:inline;float:none;font-size:13px;font-style:normal;font-variant:norma=
l;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;m=
argin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-=
right:0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:=
0px;text-transform:none;white-space:normal;word-spacing:0px"><span style=3D=
"background-color:transparent;border-bottom-color:rgb(34,34,34);border-bott=
om-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);borde=
r-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,34);bo=
rder-right-style:none;border-right-width:0px;border-top-color:rgb(34,34,34)=
;border-top-style:none;border-top-width:0px;color:rgb(34,34,34);display:inl=
ine;float:none;font-size:13px;font-style:normal;font-variant:normal;font-we=
ight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin-rig=
ht:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right:0px=
;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px;text-=
transform:none;white-space:normal;word-spacing:0px"></span></span></span></=
span></font></div><div><font face=3D"arial,sans-serif"><span style=3D"text-=
align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-s=
pacing:normal;font-size:13px;font-style:normal;font-variant:normal;font-wei=
ght:400;text-decoration:none;word-spacing:0px;display:inline!important;whit=
e-space:normal;float:none;background-color:transparent"><span style=3D"marg=
in:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34=
,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13=
px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:no=
ne;word-spacing:0px;display:inline;white-space:normal;float:none;background=
-color:transparent"><span style=3D"background-color:transparent;border-bott=
om-color:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px;bor=
der-left-color:rgb(34,34,34);border-left-style:none;border-left-width:0px;b=
order-right-color:rgb(34,34,34);border-right-style:none;border-right-width:=
0px;border-top-color:rgb(34,34,34);border-top-style:none;border-top-width:0=
px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;font-style:=
normal;font-variant:normal;font-weight:400;letter-spacing:normal;margin-bot=
tom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;=
padding-left:0px;padding-right:0px;padding-top:0px;text-align:left;text-dec=
oration:none;text-indent:0px;text-transform:none;white-space:normal;word-sp=
acing:0px"><span style=3D"background-color:transparent;border-bottom-color:=
rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px;border-left-=
color:rgb(34,34,34);border-left-style:none;border-left-width:0px;border-rig=
ht-color:rgb(34,34,34);border-right-style:none;border-right-width:0px;borde=
r-top-color:rgb(34,34,34);border-top-style:none;border-top-width:0px;color:=
rgb(34,34,34);display:inline;float:none;font-size:13px;font-style:normal;fo=
nt-variant:normal;font-weight:400;letter-spacing:normal;margin-bottom:0px;m=
argin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-l=
eft:0px;padding-right:0px;padding-top:0px;text-align:left;text-decoration:n=
one;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px=
"><br></span></span></span></span></font></div><font face=3D"arial,sans-ser=
if"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;=
text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font=
-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;displ=
ay:inline!important;white-space:normal;float:none;background-color:transpar=
ent"><span style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-al=
ign:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spa=
cing:normal;font-size:13px;font-style:normal;font-variant:normal;font-weigh=
t:400;text-decoration:none;word-spacing:0px;display:inline;white-space:norm=
al;float:none;background-color:transparent"><span style=3D"background-color=
:transparent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;bor=
der-bottom-width:0px;border-left-color:rgb(34,34,34);border-left-style:none=
;border-left-width:0px;border-right-color:rgb(34,34,34);border-right-style:=
none;border-right-width:0px;border-top-color:rgb(34,34,34);border-top-style=
:none;border-top-width:0px;color:rgb(34,34,34);display:inline;float:none;fo=
nt-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter-s=
pacing:normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top=
:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;=
text-align:left;text-decoration:none;text-indent:0px;text-transform:none;wh=
ite-space:normal;word-spacing:0px"><span style=3D"background-color:transpar=
ent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-botto=
m-width:0px;border-left-color:rgb(34,34,34);border-left-style:none;border-l=
eft-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;bord=
er-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;bor=
der-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size:1=
3px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:no=
rmal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padd=
ing-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-alig=
n:left;text-decoration:none;text-indent:0px;text-transform:none;white-space=
:normal;word-spacing:0px"><div><br></div></span></span></span></span></font=
><div><font face=3D"arial,sans-serif"><span style=3D"text-align:left;color:=
rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;fon=
t-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-deco=
ration:none;word-spacing:0px;display:inline!important;white-space:normal;fl=
oat:none;background-color:transparent"><span style=3D"margin:0px;padding:0p=
x;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transfo=
rm:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:nor=
mal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0=
px;display:inline;white-space:normal;float:none;background-color:transparen=
t"><span style=3D"background-color:transparent;border-bottom-color:rgb(34,3=
4,34);border-bottom-style:none;border-bottom-width:0px;border-left-color:rg=
b(34,34,34);border-left-style:none;border-left-width:0px;border-right-color=
:rgb(34,34,34);border-right-style:none;border-right-width:0px;border-top-co=
lor:rgb(34,34,34);border-top-style:none;border-top-width:0px;color:rgb(34,3=
4,34);display:inline;float:none;font-size:13px;font-style:normal;font-varia=
nt:normal;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-le=
ft:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;=
padding-right:0px;padding-top:0px;text-align:left;text-decoration:none;text=
-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span =
style=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);bor=
der-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,3=
4);border-left-style:none;border-left-width:0px;border-right-color:rgb(34,3=
4,34);border-right-style:none;border-right-width:0px;border-top-color:rgb(3=
4,34,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);dis=
play:inline;float:none;font-size:13px;font-style:normal;font-variant:normal=
;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;ma=
rgin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-r=
ight:0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0=
px;text-transform:none;white-space:normal;word-spacing:0px">That is a major=
difference from lifetime extension - we can have many-to-one mapping witho=
ut any semantic or implementation problems.=C2=A0<span style=3D"display:inl=
ine!important;float:none;background-color:transparent;color:rgb(34,34,34);f=
ont-family:arial,sans-serif;font-size:13px;font-style:normal;font-variant:n=
ormal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration=
:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px">Lifetime extension does not allow copies of a view/ref to extend with t=
he lifetime of the object.</span></span></span></span></span></font></div><=
div><font face=3D"arial,sans-serif"><span style=3D"text-align:left;color:rg=
b(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-=
size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decora=
tion:none;word-spacing:0px;display:inline!important;white-space:normal;floa=
t:none;background-color:transparent"><span style=3D"margin:0px;padding:0px;=
border:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform=
:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:norma=
l;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px=
;display:inline;white-space:normal;float:none;background-color:transparent"=
><span style=3D"background-color:transparent;border-bottom-color:rgb(34,34,=
34);border-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(=
34,34,34);border-left-style:none;border-left-width:0px;border-right-color:r=
gb(34,34,34);border-right-style:none;border-right-width:0px;border-top-colo=
r:rgb(34,34,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,=
34);display:inline;float:none;font-size:13px;font-style:normal;font-variant=
:normal;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left=
:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;pa=
dding-right:0px;padding-top:0px;text-align:left;text-decoration:none;text-i=
ndent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span st=
yle=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);borde=
r-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34)=
;border-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,=
34);border-right-style:none;border-right-width:0px;border-top-color:rgb(34,=
34,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);displ=
ay:inline;float:none;font-size:13px;font-style:normal;font-variant:normal;f=
ont-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;marg=
in-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-rig=
ht:0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px=
;text-transform:none;white-space:normal;word-spacing:0px">We are also not l=
imited to initialization only - the monitoring can (re)start at the call of=
reset() instead on constructor call only. Lifetime extension deals with in=
itialization exclusively.=C2=A0</span></span></span></span></font></div><di=
v><font face=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb(=
34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-si=
ze:13px;font-style:normal;font-variant:normal;font-weight:400;text-decorati=
on:none;word-spacing:0px;display:inline!important;white-space:normal;float:=
none;background-color:transparent"><span style=3D"margin:0px;padding:0px;bo=
rder:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:n=
one;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;=
font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;d=
isplay:inline;white-space:normal;float:none;background-color:transparent"><=
span style=3D"background-color:transparent;border-bottom-color:rgb(34,34,34=
);border-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34=
,34,34);border-left-style:none;border-left-width:0px;border-right-color:rgb=
(34,34,34);border-right-style:none;border-right-width:0px;border-top-color:=
rgb(34,34,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34=
);display:inline;float:none;font-size:13px;font-style:normal;font-variant:n=
ormal;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0=
px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padd=
ing-right:0px;padding-top:0px;text-align:left;text-decoration:none;text-ind=
ent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span styl=
e=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);border-=
bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);b=
order-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,34=
);border-right-style:none;border-right-width:0px;border-top-color:rgb(34,34=
,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);display=
:inline;float:none;font-size:13px;font-style:normal;font-variant:normal;fon=
t-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin=
-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right=
:0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px;t=
ext-transform:none;white-space:normal;word-spacing:0px"><br></span></span><=
/span></span></font></div><div><font face=3D"arial,sans-serif"><span style=
=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px=
;letter-spacing:normal;font-size:13px;font-style:normal;font-variant:normal=
;font-weight:400;text-decoration:none;word-spacing:0px;display:inline!impor=
tant;white-space:normal;float:none;background-color:transparent"><span styl=
e=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;color:=
rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;fon=
t-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-deco=
ration:none;word-spacing:0px;display:inline;white-space:normal;float:none;b=
ackground-color:transparent"><span style=3D"background-color:transparent;bo=
rder-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-widt=
h:0px;border-left-color:rgb(34,34,34);border-left-style:none;border-left-wi=
dth:0px;border-right-color:rgb(34,34,34);border-right-style:none;border-rig=
ht-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;border-to=
p-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;fo=
nt-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;m=
argin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bo=
ttom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:left=
;text-decoration:none;text-indent:0px;text-transform:none;white-space:norma=
l;word-spacing:0px"><span style=3D"background-color:transparent;border-bott=
om-color:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px;bor=
der-left-color:rgb(34,34,34);border-left-style:none;border-left-width:0px;b=
order-right-color:rgb(34,34,34);border-right-style:none;border-right-width:=
0px;border-top-color:rgb(34,34,34);border-top-style:none;border-top-width:0=
px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;font-style:=
normal;font-variant:normal;font-weight:400;letter-spacing:normal;margin-bot=
tom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;=
padding-left:0px;padding-right:0px;padding-top:0px;text-align:left;text-dec=
oration:none;text-indent:0px;text-transform:none;white-space:normal;word-sp=
acing:0px"><br></span></span></span></span></font></div><div>How can perfec=
t forwarding interfere in all this?=C2=A0</div><div><br></div><div><br></di=
v><div><font face=3D"courier new,monospace"><span class=3D"">template<ty=
pename T, typename ...Args><br></span>auto init(Args&&... arg)<b=
r>{<br>=C2=A0 return T(std::forward<Args>(arg)...); //< observer_p=
tr starts monitoring &arg<br>}<br><br>int main()<br>{ <br>=C2=A0 auto v=
=3D init<A_view>(A{}); //< both A_view and A allocated. A_view us=
able before the ';' when ~A is called<br>}</font></div><div><font f=
ace=3D"courier new"><br></font></div><div>If copy elision does not kick-in =
nothing changes - copy is safe and defined, lifetime of A is the same.</div=
><div><br></div><div>If we pass arguments and create A in init() instead ( =
<font face=3D"courier new,monospace">return</font>=C2=A0 <span style=3D"dis=
play:inline!important;float:none;background-color:transparent;color:rgb(34,=
34,34);font-family:courier new,monospace;font-size:13px;font-style:normal;f=
ont-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;te=
xt-decoration:none;text-indent:0px;text-transform:none;white-space:normal;w=
ord-spacing:0px">T(A(std::forward<Args>(arg)...<wbr>)); </span>), the=
n the <font face=3D"courier new,monospace">observer_ptr </font>is still cre=
ated with a valid address, </div><div>however, after we return will not be =
able to use<font face=3D"courier new,monospace"> A_view</font> in any way, =
including before the <font face=3D"courier new,monospace">';'.=C2=
=A0</font></div><div><b></b><i></i><u></u><sub></sub><sup></sup><strike></s=
trike><font face=3D"courier new,monospace"><br></font></div><div>If both th=
ere is no elision and A is created when initializing T inside init, then th=
e returned view can be created from a dangling view.=C2=A0</div><div>We cou=
ld allow views from dangling views to be created, however=C2=A0<span style=
=3D"display:inline!important;float:none;background-color:transparent;color:=
rgb(34,34,34);font-family:"Arial","Helvetica",sans-seri=
f;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;lett=
er-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text=
-transform:none;white-space:normal;word-spacing:0px">no dtor will be monito=
red and</span> all uses of the view will be illegal until destroyed/reset/r=
elease-ed. </div><div>We could also issue a warning on coping from dangling=
view without problem.</div><div><br></div><div><br></div><div><br></div><d=
iv><font face=3D"arial,sans-serif"><b><i><br></i></b></font></div><div>=C2=
=A0</div></div><span class=3D"">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/4fa7=
92ec-1f51-4357-<wbr>a65a-2ce3c10c60c0%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALvx3hYQHFXi5eRrcdCGEqWj-n4w4NKYDpRx=
4G_U16i%2B2VS5nQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hYQHFXi5e=
RrcdCGEqWj-n4w4NKYDpRx4G_U16i%2B2VS5nQ%40mail.gmail.com</a>.<br />
--001a114411780b9ee7056336617d--
.
Author: mihailnajdenov@gmail.com
Date: Sat, 20 Jan 2018 08:36:08 -0800 (PST)
Raw View
------=_Part_2493_1727009190.1516466168923
Content-Type: multipart/alternative;
boundary="----=_Part_2494_1021269791.1516466168924"
------=_Part_2494_1021269791.1516466168924
Content-Type: text/plain; charset="UTF-8"
On Saturday, January 20, 2018 at 4:54:53 PM UTC+2, Richard Hodges wrote:
>
> > Copies of observer_ptr still monitor the same address, but with a
> different scope - their dtor, release or reset.
>
> It would be nice if this were enough.
>
> consider
>
> auto& exec = some_async_executor();
> auto up = std::make_unique<Foo>();
>
> auto p = observer_ptr(up.get());
> exec.post([p] { something_with(*p); }); // A
> exec.post([up = std::move(up)] { something_with(*up); }); // B
> exec.post([p] { something_with(*p); }); // C
>
> Assume that B's lambda invocation may or may not complete before C's lambda
> invocation.
>
> I can't see how this could be statically analysed. It's an undetectable
> logic error, since as far as the compiler is concerned, it has no way of
> knowing that C's p may outlive B's up.
>
> Note that at the point of the construction of each of the 3 lambdas, the
> pointers captured are all valid (except in the crossing case where there is
> a context switch after the post at B).
>
In any case this does heap allocation for the views (the lambdas, inside
the exec class) and presumably threading after that. Both are impossible to
track.
For both however we have nice tools - shared and week ptr.
Which is ironic - the complex code is more safe then the trivial one. Yes
you could use the heavyweight tools for simple tasks, but that is not zero
overhead any more.
Static analysis is the tool to help us with the common, simple, yet
(terribly) unsafe tasks, still keeping zero overhead.
Having said that, there are scenarios where tracking will not give accurate
prediction - the destruction might, for instance, depend upon some real
time state.
That is the reason, these cannot be errors, only warnings.
The compiler should, however, be able to see all paths leading to
destruction even the once behind real time check/uncertainty and warn that
"it *might *dangle" or that "no one can be certain, even you!".
In your example, the compiler should warn it can't predict the observer -
has no visibility over its lifetime and/or the observed destruction is
behind real time uncertainty.
He might even suggest alternative like share/weak ptr, because *observe_ptr
was not the right tool in the first place!* The compiler will only reaffirm
that fact.
>
>
>
> On 20 January 2018 at 12:12, <mihailn...@gmail.com <javascript:>> wrote:
>
>>
>>
>> On Friday, January 19, 2018 at 10:19:40 PM UTC+2, Nicol Bolas wrote:
>>>
>>> On Friday, January 19, 2018 at 7:30:52 AM UTC-5, mihailn...@gmail.com
>>> wrote:
>>>>
>>>> Can we "just" define special behavior of observer_ptr (in
>>>> debug/analyze mode) and solve all cases of lifetime monitoring (under the
>>>> said limitations) - from smart pointers to function_view?
>>>>
>>>
>>> That's not "behavior" of the type. There is no actual code in
>>> `observer_ptr` that does anything you're talking about. It's simply a
>>> compiler or tool that sees you using this particular type and starts
>>> looking at things because of it.
>>>
>>
>> If the constructor and reset of observer_ptr are decorated with
>> something like [[debug:observe_destruction]] the behavior of observer_ptr
>> will be enforced by the compiler.
>>
>> The behavior, use and definition of observer_ptr are not changed.
>>
>>
>>>
>>> It should also be noted that this still doesn't handle perfect
>>> forwarding. Not unless it is the caller of the function who wraps the
>>> parameter in an `observer_ptr`.
>>>
>>
>> class A_view
>> {
>> A_view(const A* pa) : _p(pa) {}
>> A_view(const A& a) : _p(&a) {}
>> A_view(A&& a) : _p(&a) {}
>>
>> observer_ptr<const A> _p;
>> };
>>
>> observer_ptr will monitor addressof(*_p) for ~A() call. The scope of
>> monitoring is ~observer_ptr() or release() call.
>>
>> Copies of observer_ptr still monitor the same address, but with a
>> different scope - their dtor, release or reset.
>>
>>
>> That is a major difference from lifetime extension - we can have
>> many-to-one mapping without any semantic or implementation problems. Lifetime
>> extension does not allow copies of a view/ref to extend with the lifetime
>> of the object.
>> We are also not limited to initialization only - the monitoring can
>> (re)start at the call of reset() instead on constructor call only. Lifetime
>> extension deals with initialization exclusively.
>>
>>
>> How can perfect forwarding interfere in all this?
>>
>>
>> template<typename T, typename ...Args>
>> auto init(Args&&... arg)
>> {
>> return T(std::forward<Args>(arg)...); //< observer_ptr starts
>> monitoring &arg
>> }
>>
>> int main()
>> {
>> auto v = init<A_view>(A{}); //< both A_view and A allocated. A_view
>> usable before the ';' when ~A is called
>> }
>>
>> If copy elision does not kick-in nothing changes - copy is safe and
>> defined, lifetime of A is the same.
>>
>> If we pass arguments and create A in init() instead ( return T(A(std::forward<Args>(arg)...));
>> ), then the observer_ptr is still created with a valid address,
>> however, after we return will not be able to use A_view in any way,
>> including before the ';'.
>>
>> If both there is no elision and A is created when initializing T inside
>> init, then the returned view can be created from a dangling view.
>> We could allow views from dangling views to be created, however no dtor
>> will be monitored and all uses of the view will be illegal until
>> destroyed/reset/release-ed.
>> We could also issue a warning on coping from dangling view without
>> problem.
>>
>>
>>
>>
>>
>>
>> --
>> 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-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/00d91d4c-4ee7-4dbd-a547-3dd844f5685d%40isocpp.org.
------=_Part_2494_1021269791.1516466168924
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Saturday, January 20, 2018 at 4:54:53 PM UTC+2,=
Richard Hodges wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">>=C2=A0<span style=3D"font-size:13px">Copies of=C2=A0</span><sp=
an style=3D"font-size:13px;background-color:transparent;margin:0px;padding:=
0px;border:0px rgb(34,34,34)">observer_ptr still monitor the same address, =
but with a different scope - their dtor, release or reset.</span><div><span=
style=3D"font-size:13px;background-color:transparent;margin:0px;padding:0p=
x;border:0px rgb(34,34,34)"><br></span></div><div><span style=3D"font-size:=
13px;background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,=
34,34)">It would be nice if this were enough.</span></div><div><span style=
=3D"font-size:13px;background-color:transparent;margin:0px;padding:0px;bord=
er:0px rgb(34,34,34)"><br></span></div><div><span style=3D"font-size:13px;b=
ackground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)=
">consider</span></div><div><span style=3D"font-size:13px;background-color:=
transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><br></span></d=
iv><div><span style=3D"font-size:13px;background-color:transparent;margin:0=
px;padding:0px;border:0px rgb(34,34,34)"><font face=3D"monospace, monospace=
">auto& exec =3D some_async_executor();</font></span></div><div><span s=
tyle=3D"font-size:13px;background-color:transparent;margin:0px;padding:0px;=
border:0px rgb(34,34,34)"><font face=3D"monospace, monospace">auto up =3D s=
td::make_unique<Foo>();</font></span></div><div><span style=3D"font-s=
ize:13px;background-color:transparent;margin:0px;padding:0px;border:0px rgb=
(34,34,34)"><font face=3D"monospace, monospace"><br></font></span></div><di=
v><span style=3D"font-size:13px;background-color:transparent;margin:0px;pad=
ding:0px;border:0px rgb(34,34,34)"><font face=3D"monospace, monospace">auto=
p =3D observer_ptr(up.get());</font></span></div><div><div><span style=3D"=
font-size:13px;background-color:transparent;margin:0px;padding:0px;border:0=
px rgb(34,34,34)"><font face=3D"monospace, monospace">exec.post([p] { somet=
hing_with(*p); });=C2=A0 =C2=A0 // A</font></span></div></div><div><span st=
yle=3D"background-color:transparent;margin:0px;padding:0px;border:0px rgb(3=
4,34,34)"><div style=3D"font-size:small"><span style=3D"font-size:13px;back=
ground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><=
font face=3D"monospace, monospace">exec.post([up =3D std::move(up)] { somet=
hing_with(*up); }); // B</font></span></div></span><div><span style=3D"back=
ground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><=
span style=3D"background-color:transparent;margin:0px;padding:0px;border:0p=
x rgb(34,34,34)"><div style=3D"font-size:small"><span style=3D"font-size:13=
px;background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34=
,34)"><font face=3D"monospace, monospace">exec.post([p] { something_with(*p=
); });=C2=A0 =C2=A0// C</font></span></div><div style=3D"font-size:small"><=
span style=3D"font-size:13px;background-color:transparent;margin:0px;paddin=
g:0px;border:0px rgb(34,34,34)"><br></span></div><div>Assume that B's l=
ambda invocation may or may not complete before C's=C2=A0<span style=3D=
"background-color:transparent">lambda invocation</span><span style=3D"backg=
round-color:transparent">.</span></div><div style=3D"font-size:small"><span=
style=3D"font-size:13px;background-color:transparent;margin:0px;padding:0p=
x;border:0px rgb(34,34,34)"><br></span></div><div style=3D"font-size:small"=
><span style=3D"font-size:13px;background-color:transparent;margin:0px;padd=
ing:0px;border:0px rgb(34,34,34)">I can't see how this could be statica=
lly analysed. It's an undetectable logic error, since as far as the com=
piler is concerned, it has no way of knowing that C's <font face=3D"mon=
ospace, monospace">p</font> may outlive B's <font face=3D"monospace, mo=
nospace">up</font>.</span></div><div style=3D"font-size:small"><span style=
=3D"font-size:13px;background-color:transparent;margin:0px;padding:0px;bord=
er:0px rgb(34,34,34)"><br></span></div></span></span><div style=3D"font-siz=
e:13px"><span style=3D"background-color:transparent;margin:0px;padding:0px;=
border:0px rgb(34,34,34)"><span style=3D"background-color:transparent;margi=
n:0px;padding:0px;border:0px rgb(34,34,34)"><span style=3D"font-size:13px;b=
ackground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)=
">Note that at the point of the construction of each of the 3 lambdas, the =
pointers captured are all valid (except in the crossing case where there is=
a context switch after the post at B).</span></span></span></div></div></d=
iv></div></blockquote><div><br></div><div><br></div><div>In any case this d=
oes heap allocation for the views (the lambdas, inside the exec class) and =
presumably threading after that. Both are impossible to track. </div><div><=
br></div><div><br></div><div>For both however we have nice tools - shared a=
nd week ptr.=C2=A0</div><div><br></div><div>Which is ironic - the complex c=
ode is more safe then the trivial one. Yes you could use the heavyweight to=
ols for simple tasks, but that is not zero overhead any more.=C2=A0</div><d=
iv><br></div><div>Static analysis is the tool to help us with the common, s=
imple, yet (terribly) unsafe tasks, still keeping zero overhead.</div><div>=
<br></div><div><br></div><div>Having said that, there are scenarios where t=
racking will not give accurate prediction - the destruction might, for inst=
ance, depend upon some real time state.</div><div>That is the reason, these=
cannot be errors, only warnings.</div><div>The compiler should, however, b=
e able to see all paths leading to destruction even the once behind real ti=
me check/uncertainty and warn that "it <i>might </i>dangle" or th=
at "no one can be certain, even you!".</div><div><br></div><div>I=
n your example, the compiler should warn it can't predict the observer =
- has no visibility over its lifetime and/or the observed destruction is be=
hind real time uncertainty.=C2=A0<b><i></i></b></div><div>He might even sug=
gest alternative like share/weak ptr, because <i>observe_ptr was not the ri=
ght tool in the first place!</i> The compiler will only reaffirm that fact.=
=C2=A0</div><div><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quot=
e" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddin=
g-left: 1ex;"><div dir=3D"ltr"><div><span style=3D"background-color:transpa=
rent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><div><span style=3D"b=
ackground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)=
"><div style=3D"font-size:13px"><span style=3D"font-size:13px;background-co=
lor:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><br></span=
></div><div style=3D"font-size:13px"><span style=3D"font-size:13px;backgrou=
nd-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><br><=
/span></div></span></div></span></div></div><div><br><div class=3D"gmail_qu=
ote">On 20 January 2018 at 12:12, <span dir=3D"ltr"><<a onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
;javascript:';return true;" href=3D"javascript:" target=3D"_blank" rel=
=3D"nofollow" gdf-obfuscated-mailto=3D"2Rr69cYVAwAJ">mihailn...@gmail.com</=
a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0=
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><sp=
an><br><br>On Friday, January 19, 2018 at 10:19:40 PM UTC+2, Nicol Bolas wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Friday, Jan=
uary 19, 2018 at 7:30:52 AM UTC-5, <a>mihailn...@gmail.com</a> wrote:<block=
quote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left=
:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><font face=3D"arial=
,sans-serif"><span style=3D"text-align:left;color:rgb(34,34,34);text-transf=
orm:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:no=
rmal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:=
0px;display:inline!important;white-space:normal;float:none;background-color=
:transparent">Can we <span style=3D"display:inline!important;float:none;bac=
kground-color:transparent;color:rgb(34,34,34);font-family:arial,sans-serif;=
font-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter=
-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-t=
ransform:none;white-space:normal;word-spacing:0px">"just" </span>=
define special behavior of=C2=A0<span style=3D"background-color:transparent=
;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-w=
idth:0px;border-left-color:rgb(34,34,34);border-left-style:none;border-left=
-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;border-=
right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;border=
-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-family:ar=
ial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-we=
ight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin-rig=
ht:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right:0px=
;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px;text-=
transform:none;white-space:normal;word-spacing:0px">observer_ptr (in debug/=
analyze mode) and solve all cases of lifetime monitoring (under the said li=
mitations) - from smart pointers to function_view?</span></span></font></di=
v></div></blockquote><div><br></div><div>That's not "behavior"=
; of the type. There is no actual code in `observer_ptr` that does anything=
you're talking about. It's simply a compiler or tool that sees you=
using this particular type and starts looking at things because of it.</di=
v></div></blockquote><div><br></div></span><div>If the constructor and rese=
t of <span style=3D"display:inline!important;float:none;background-color:tr=
ansparent;color:rgb(34,34,34);font-family:"Arial","Helvetica=
",sans-serif;font-size:13px;font-style:normal;font-variant:normal;font=
-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text=
-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">observ=
er_ptr are decorated with something like<font face=3D"courier new,monospace=
"> [[debug:observe_destruction]] </font>the=C2=A0<span style=3D"display:inl=
ine!important;float:none;background-color:transparent;color:rgb(34,34,34);f=
ont-family:"Arial","Helvetica",sans-serif;font-size:13p=
x;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:norm=
al;text-align:left;text-decoration:none;text-indent:0px;text-transform:none=
;white-space:normal;word-spacing:0px">behavior of=C2=A0<span>observer_ptr w=
ill be enforced by the compiler. </span></span></span></div><div><span styl=
e=3D"display:inline!important;float:none;background-color:transparent;color=
:rgb(34,34,34);font-family:"Arial","Helvetica",sans-ser=
if;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;let=
ter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;tex=
t-transform:none;white-space:normal;word-spacing:0px"><span style=3D"displa=
y:inline!important;float:none;background-color:transparent;color:rgb(34,34,=
34);font-family:"Arial","Helvetica",sans-serif;font-siz=
e:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing=
:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform=
:none;white-space:normal;word-spacing:0px"><span><br></span></span></span><=
/div><div><span style=3D"display:inline!important;float:none;background-col=
or:transparent;color:rgb(34,34,34);font-family:"Arial","Helv=
etica",sans-serif;font-size:13px;font-style:normal;font-variant:normal=
;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none=
;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><=
span style=3D"display:inline!important;float:none;background-color:transpar=
ent;color:rgb(34,34,34);font-family:"Arial","Helvetica"=
,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weigh=
t:400;letter-spacing:normal;text-align:left;text-decoration:none;text-inden=
t:0px;text-transform:none;white-space:normal;word-spacing:0px"><span>The be=
havior, use and definition of observer_ptr are not changed. =C2=A0</span></=
span></span></div><span><div>=C2=A0</div><blockquote class=3D"gmail_quote" =
style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr"><div><br></div><div>It should also be noted that thi=
s still doesn't handle perfect forwarding. Not unless it is the caller =
of the function who wraps the parameter in an `observer_ptr`.</div></div></=
blockquote><div><br></div></span><div><font face=3D"courier new,monospace">=
class A_view</font></div><div><font face=3D"courier new,monospace">{</font>=
</div><div><font face=3D"courier new,monospace">=C2=A0 </font><font face=3D=
"courier new,monospace"><span style=3D"text-align:left;color:rgb(34,34,34);=
text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;fo=
nt-style:normal;font-variant:normal;font-weight:400;text-decoration:none;wo=
rd-spacing:0px;display:inline!important;white-space:normal;float:none;backg=
round-color:transparent">A_view(const A* pa) : _p(pa) {}</span></font></div=
><div><font face=3D"courier new,monospace">=C2=A0 <span style=3D"text-align=
:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacin=
g:normal;font-size:13px;font-style:normal;font-variant:normal;font-weight:4=
00;text-decoration:none;word-spacing:0px;display:inline!important;white-spa=
ce:normal;float:none;background-color:transparent"><span>A_view(const A&=
; a) : _p(&a) {}</span></span></font></div><div><font face=3D"courier n=
ew,monospace">=C2=A0 <span style=3D"text-align:left;color:rgb(34,34,34);tex=
t-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-=
variant:normal;word-spacing:0px;display:inline!important;white-space:normal=
;float:none;background-color:transparent"><span style=3D"margin:0px;padding=
:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-tran=
sform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-varian=
t:normal;word-spacing:0px;display:inline;white-space:normal;float:none;back=
ground-color:transparent"><span>A_view(A&& a) : _p(&a) {}</span=
></span></span></font></div><div><span style=3D"text-align:left;color:rgb(3=
4,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-siz=
e:13px;font-variant:normal;word-spacing:0px;display:inline!important;white-=
space:normal;float:none;background-color:transparent"><span style=3D"margin=
:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34,3=
4);text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px=
;font-variant:normal;word-spacing:0px;display:inline;white-space:normal;flo=
at:none;background-color:transparent"><span><font face=3D"courier new,monos=
pace"><br></font></span></span></span></div><div><font face=3D"courier new,=
monospace">=C2=A0 <span style=3D"text-align:left;color:rgb(34,34,34);text-t=
ransform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-var=
iant:normal;word-spacing:0px;display:inline!important;white-space:normal;fl=
oat:none;background-color:transparent"><span style=3D"margin:0px;padding:0p=
x;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transfo=
rm:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-variant:n=
ormal;word-spacing:0px;display:inline;white-space:normal;float:none;backgro=
und-color:transparent"><span>observer_ptr<const A> _p;</span><b></b><=
/span></span></font></div><div><font face=3D"courier new,monospace">};=C2=
=A0</font></div><div><font face=3D"courier new"><br></font></div><div><font=
face=3D"arial,sans-serif">observer_ptr will monitor addressof(*_p) for ~A(=
) call. The scope of monitoring is ~<span style=3D"text-align:left;color:rg=
b(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-=
size:13px;font-style:normal;font-variant:normal;font-weight:400;text-decora=
tion:none;word-spacing:0px;display:inline!important;white-space:normal;floa=
t:none;background-color:transparent">observer_ptr() or release() call.</spa=
n></font></div><div><font face=3D"arial,sans-serif"><span style=3D"text-ali=
gn:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spac=
ing:normal;font-size:13px;font-style:normal;font-variant:normal;font-weight=
:400;text-decoration:none;word-spacing:0px;display:inline!important;white-s=
pace:normal;float:none;background-color:transparent"><br></span></font></di=
v><div><font face=3D"arial,sans-serif"><span style=3D"text-align:left;color=
:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;fo=
nt-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-dec=
oration:none;word-spacing:0px;display:inline!important;white-space:normal;f=
loat:none;background-color:transparent">Copies of=C2=A0<span style=3D"margi=
n:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34,=
34);text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13p=
x;font-style:normal;font-variant:normal;font-weight:400;text-decoration:non=
e;word-spacing:0px;display:inline;white-space:normal;float:none;background-=
color:transparent"><span style=3D"background-color:transparent;border-botto=
m-color:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px;bord=
er-left-color:rgb(34,34,34);border-left-style:none;border-left-width:0px;bo=
rder-right-color:rgb(34,34,34);border-right-style:none;border-right-width:0=
px;border-top-color:rgb(34,34,34);border-top-style:none;border-top-width:0p=
x;color:rgb(34,34,34);display:inline;float:none;font-size:13px;font-style:n=
ormal;font-variant:normal;font-weight:400;letter-spacing:normal;margin-bott=
om:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;p=
adding-left:0px;padding-right:0px;padding-top:0px;text-align:left;text-deco=
ration:none;text-indent:0px;text-transform:none;white-space:normal;word-spa=
cing:0px"><span style=3D"background-color:transparent;border-bottom-color:r=
gb(34,34,34);border-bottom-style:none;border-bottom-width:0px;border-left-c=
olor:rgb(34,34,34);border-left-style:none;border-left-width:0px;border-righ=
t-color:rgb(34,34,34);border-right-style:none;border-right-width:0px;border=
-top-color:rgb(34,34,34);border-top-style:none;border-top-width:0px;color:r=
gb(34,34,34);display:inline;float:none;font-size:13px;font-style:normal;fon=
t-variant:normal;font-weight:400;letter-spacing:normal;margin-bottom:0px;ma=
rgin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-le=
ft:0px;padding-right:0px;padding-top:0px;text-align:left;text-decoration:no=
ne;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"=
><font face=3D"arial,sans-serif">observer_ptr still monitor the same addres=
s, but with a different scope - their dtor, release or reset.</font></span>=
</span></span></span></font><font face=3D"arial,sans-serif"><span style=3D"=
text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;let=
ter-spacing:normal;font-size:13px;font-style:normal;font-variant:normal;fon=
t-weight:400;text-decoration:none;word-spacing:0px;display:inline!important=
;white-space:normal;float:none;background-color:transparent"><span style=3D=
"margin:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(=
34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-si=
ze:13px;font-style:normal;font-variant:normal;font-weight:400;text-decorati=
on:none;word-spacing:0px;display:inline;white-space:normal;float:none;backg=
round-color:transparent"><span style=3D"background-color:transparent;border=
-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0p=
x;border-left-color:rgb(34,34,34);border-left-style:none;border-left-width:=
0px;border-right-color:rgb(34,34,34);border-right-style:none;border-right-w=
idth:0px;border-top-color:rgb(34,34,34);border-top-style:none;border-top-wi=
dth:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;font-s=
tyle:normal;font-variant:normal;font-weight:400;letter-spacing:normal;margi=
n-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom=
:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:left;tex=
t-decoration:none;text-indent:0px;text-transform:none;white-space:normal;wo=
rd-spacing:0px"><span style=3D"background-color:transparent;border-bottom-c=
olor:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px;border-=
left-color:rgb(34,34,34);border-left-style:none;border-left-width:0px;borde=
r-right-color:rgb(34,34,34);border-right-style:none;border-right-width:0px;=
border-top-color:rgb(34,34,34);border-top-style:none;border-top-width:0px;c=
olor:rgb(34,34,34);display:inline;float:none;font-size:13px;font-style:norm=
al;font-variant:normal;font-weight:400;letter-spacing:normal;margin-bottom:=
0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padd=
ing-left:0px;padding-right:0px;padding-top:0px;text-align:left;text-decorat=
ion:none;text-indent:0px;text-transform:none;white-space:normal;word-spacin=
g:0px"></span></span></span></span></font></div><div><font face=3D"arial,sa=
ns-serif"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform=
:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:norma=
l;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px=
;display:inline!important;white-space:normal;float:none;background-color:tr=
ansparent"><span style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);t=
ext-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;lett=
er-spacing:normal;font-size:13px;font-style:normal;font-variant:normal;font=
-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-spac=
e:normal;float:none;background-color:transparent"><span style=3D"background=
-color:transparent;border-bottom-color:rgb(34,34,34);border-bottom-style:no=
ne;border-bottom-width:0px;border-left-color:rgb(34,34,34);border-left-styl=
e:none;border-left-width:0px;border-right-color:rgb(34,34,34);border-right-=
style:none;border-right-width:0px;border-top-color:rgb(34,34,34);border-top=
-style:none;border-top-width:0px;color:rgb(34,34,34);display:inline;float:n=
one;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;le=
tter-spacing:normal;margin-bottom:0px;margin-left:0px;margin-right:0px;marg=
in-top:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-to=
p:0px;text-align:left;text-decoration:none;text-indent:0px;text-transform:n=
one;white-space:normal;word-spacing:0px"><span style=3D"background-color:tr=
ansparent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border=
-bottom-width:0px;border-left-color:rgb(34,34,34);border-left-style:none;bo=
rder-left-width:0px;border-right-color:rgb(34,34,34);border-right-style:non=
e;border-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:no=
ne;border-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-=
size:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spac=
ing:normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0p=
x;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;tex=
t-align:left;text-decoration:none;text-indent:0px;text-transform:none;white=
-space:normal;word-spacing:0px"><br></span></span></span></span></font></di=
v><font face=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb(=
34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-si=
ze:13px;font-style:normal;font-variant:normal;font-weight:400;text-decorati=
on:none;word-spacing:0px;display:inline!important;white-space:normal;float:=
none;background-color:transparent"><span style=3D"margin:0px;padding:0px;bo=
rder:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:n=
one;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;=
font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;d=
isplay:inline;white-space:normal;float:none;background-color:transparent"><=
span style=3D"background-color:transparent;border-bottom-color:rgb(34,34,34=
);border-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34=
,34,34);border-left-style:none;border-left-width:0px;border-right-color:rgb=
(34,34,34);border-right-style:none;border-right-width:0px;border-top-color:=
rgb(34,34,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34=
);display:inline;float:none;font-size:13px;font-style:normal;font-variant:n=
ormal;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0=
px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padd=
ing-right:0px;padding-top:0px;text-align:left;text-decoration:none;text-ind=
ent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span styl=
e=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);border-=
bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);b=
order-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,34=
);border-right-style:none;border-right-width:0px;border-top-color:rgb(34,34=
,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);display=
:inline;float:none;font-size:13px;font-style:normal;font-variant:normal;fon=
t-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin=
-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right=
:0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px;t=
ext-transform:none;white-space:normal;word-spacing:0px"><div><br></div></sp=
an></span></span></span></font><div><font face=3D"arial,sans-serif"><span s=
tyle=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent=
:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-variant:no=
rmal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline!i=
mportant;white-space:normal;float:none;background-color:transparent"><span =
style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;co=
lor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal=
;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-=
decoration:none;word-spacing:0px;display:inline;white-space:normal;float:no=
ne;background-color:transparent"><span style=3D"background-color:transparen=
t;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-=
width:0px;border-left-color:rgb(34,34,34);border-left-style:none;border-lef=
t-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;border=
-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;borde=
r-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13p=
x;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:norm=
al;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;paddin=
g-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:=
left;text-decoration:none;text-indent:0px;text-transform:none;white-space:n=
ormal;word-spacing:0px"><span style=3D"background-color:transparent;border-=
bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px=
;border-left-color:rgb(34,34,34);border-left-style:none;border-left-width:0=
px;border-right-color:rgb(34,34,34);border-right-style:none;border-right-wi=
dth:0px;border-top-color:rgb(34,34,34);border-top-style:none;border-top-wid=
th:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;font-st=
yle:normal;font-variant:normal;font-weight:400;letter-spacing:normal;margin=
-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:=
0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:left;text=
-decoration:none;text-indent:0px;text-transform:none;white-space:normal;wor=
d-spacing:0px">That is a major difference from lifetime extension - we can =
have many-to-one mapping without any semantic or implementation problems.=
=C2=A0<span style=3D"display:inline!important;float:none;background-color:t=
ransparent;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;=
font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal=
;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;w=
hite-space:normal;word-spacing:0px">Lifetime extension does not allow copie=
s of a view/ref to extend with the lifetime of the object.</span></span></s=
pan></span></span></font></div><div><font face=3D"arial,sans-serif"><span s=
tyle=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent=
:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-variant:no=
rmal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline!i=
mportant;white-space:normal;float:none;background-color:transparent"><span =
style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;co=
lor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal=
;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-=
decoration:none;word-spacing:0px;display:inline;white-space:normal;float:no=
ne;background-color:transparent"><span style=3D"background-color:transparen=
t;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-=
width:0px;border-left-color:rgb(34,34,34);border-left-style:none;border-lef=
t-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;border=
-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;borde=
r-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13p=
x;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:norm=
al;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;paddin=
g-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:=
left;text-decoration:none;text-indent:0px;text-transform:none;white-space:n=
ormal;word-spacing:0px"><span style=3D"background-color:transparent;border-=
bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px=
;border-left-color:rgb(34,34,34);border-left-style:none;border-left-width:0=
px;border-right-color:rgb(34,34,34);border-right-style:none;border-right-wi=
dth:0px;border-top-color:rgb(34,34,34);border-top-style:none;border-top-wid=
th:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;font-st=
yle:normal;font-variant:normal;font-weight:400;letter-spacing:normal;margin=
-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:=
0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:left;text=
-decoration:none;text-indent:0px;text-transform:none;white-space:normal;wor=
d-spacing:0px">We are also not limited to initialization only - the monitor=
ing can (re)start at the call of reset() instead on constructor call only. =
Lifetime extension deals with initialization exclusively.=C2=A0</span></spa=
n></span></span></font></div><div><font face=3D"arial,sans-serif"><span sty=
le=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0=
px;letter-spacing:normal;font-size:13px;font-style:normal;font-variant:norm=
al;font-weight:400;text-decoration:none;word-spacing:0px;display:inline!imp=
ortant;white-space:normal;float:none;background-color:transparent"><span st=
yle=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;colo=
r:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;f=
ont-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-de=
coration:none;word-spacing:0px;display:inline;white-space:normal;float:none=
;background-color:transparent"><span style=3D"background-color:transparent;=
border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-wi=
dth:0px;border-left-color:rgb(34,34,34);border-left-style:none;border-left-=
width:0px;border-right-color:rgb(34,34,34);border-right-style:none;border-r=
ight-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;border-=
top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;=
font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal=
;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-=
bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:le=
ft;text-decoration:none;text-indent:0px;text-transform:none;white-space:nor=
mal;word-spacing:0px"><span style=3D"background-color:transparent;border-bo=
ttom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px;b=
order-left-color:rgb(34,34,34);border-left-style:none;border-left-width:0px=
;border-right-color:rgb(34,34,34);border-right-style:none;border-right-widt=
h:0px;border-top-color:rgb(34,34,34);border-top-style:none;border-top-width=
:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;font-styl=
e:normal;font-variant:normal;font-weight:400;letter-spacing:normal;margin-b=
ottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0p=
x;padding-left:0px;padding-right:0px;padding-top:0px;text-align:left;text-d=
ecoration:none;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px"><br></span></span></span></span></font></div><div><font face=
=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb(34,34,34);te=
xt-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font=
-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word=
-spacing:0px;display:inline!important;white-space:normal;float:none;backgro=
und-color:transparent"><span style=3D"margin:0px;padding:0px;border:0px rgb=
(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:none;text-ind=
ent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-variant=
:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inlin=
e;white-space:normal;float:none;background-color:transparent"><span style=
=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);border-b=
ottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);bo=
rder-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,34)=
;border-right-style:none;border-right-width:0px;border-top-color:rgb(34,34,=
34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);display:=
inline;float:none;font-size:13px;font-style:normal;font-variant:normal;font=
-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin-=
right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right:=
0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px;te=
xt-transform:none;white-space:normal;word-spacing:0px"><span style=3D"backg=
round-color:transparent;border-bottom-color:rgb(34,34,34);border-bottom-sty=
le:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);border-left=
-style:none;border-left-width:0px;border-right-color:rgb(34,34,34);border-r=
ight-style:none;border-right-width:0px;border-top-color:rgb(34,34,34);borde=
r-top-style:none;border-top-width:0px;color:rgb(34,34,34);display:inline;fl=
oat:none;font-size:13px;font-style:normal;font-variant:normal;font-weight:4=
00;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin-right:0px=
;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;paddi=
ng-top:0px;text-align:left;text-decoration:none;text-indent:0px;text-transf=
orm:none;white-space:normal;word-spacing:0px"><br></span></span></span></sp=
an></font></div><div>How can perfect forwarding interfere in all this?=C2=
=A0</div><div><br></div><div><br></div><div><font face=3D"courier new,monos=
pace"><span>template<typename T, typename ...Args><br></span>auto ini=
t(Args&&... arg)<br>{<br>=C2=A0 return T(std::forward<Args>(a=
rg)...); //< observer_ptr starts monitoring &arg<br>}<br><br>int mai=
n()<br>{ <br>=C2=A0 auto v =3D init<A_view>(A{}); //< both A_view =
and A allocated. A_view usable before the ';' when ~A is called<br>=
}</font></div><div><font face=3D"courier new"><br></font></div><div>If copy=
elision does not kick-in nothing changes - copy is safe and defined, lifet=
ime of A is the same.</div><div><br></div><div>If we pass arguments and cre=
ate A in init() instead ( <font face=3D"courier new,monospace">return</font=
>=C2=A0 <span style=3D"display:inline!important;float:none;background-color=
:transparent;color:rgb(34,34,34);font-family:courier new,monospace;font-siz=
e:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing=
:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform=
:none;white-space:normal;word-spacing:0px">T(A(std::forward<Args>(arg=
)...<wbr>)); </span>), then the <font face=3D"courier new,monospace">observ=
er_ptr </font>is still created with a valid address, </div><div>however, af=
ter we return will not be able to use<font face=3D"courier new,monospace"> =
A_view</font> in any way, including before the <font face=3D"courier new,mo=
nospace">';'.=C2=A0</font></div><div><b></b><i></i><u></u><sub></su=
b><sup></sup><strike></strike><font face=3D"courier new,monospace"><br></fo=
nt></div><div>If both there is no elision and A is created when initializin=
g T inside init, then the returned view can be created from a dangling view=
..=C2=A0</div><div>We could allow views from dangling views to be created, h=
owever=C2=A0<span style=3D"display:inline!important;float:none;background-c=
olor:transparent;color:rgb(34,34,34);font-family:"Arial","He=
lvetica",sans-serif;font-size:13px;font-style:normal;font-variant:norm=
al;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:no=
ne;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"=
>no dtor will be monitored and</span> all uses of the view will be illegal =
until destroyed/reset/release-ed. </div><div>We could also issue a warning =
on coping from dangling view without problem.</div><div><br></div><div><br>=
</div><div><br></div><div><font face=3D"arial,sans-serif"><b><i><br></i></b=
></font></div><div>=C2=A0</div></div><span>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a onmousedown=3D"this.href=3D'javascript:';return true;" o=
nclick=3D"this.href=3D'javascript:';return true;" href=3D"javascrip=
t:" target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"2Rr69cYVAwA=
J">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a onmousedown=3D"this.href=3D'jav=
ascript:';return true;" onclick=3D"this.href=3D'javascript:';re=
turn true;" href=3D"javascript:" target=3D"_blank" rel=3D"nofollow" gdf-obf=
uscated-mailto=3D"2Rr69cYVAwAJ">std-pr...@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a onmousedown=3D"this.href=3D'=
;https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51=
-4357-a65a-2ce3c10c60c0%40isocpp.org?utm_medium\x3demail\x26utm_source\x3df=
ooter';return true;" onclick=3D"this.href=3D'https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0=
%40isocpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;=
" href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4fa7=
92ec-1f51-4357-a65a-2ce3c10c60c0%40isocpp.org?utm_medium=3Demail&utm_so=
urce=3Dfooter" target=3D"_blank" rel=3D"nofollow">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/4fa792ec-1f51-4357-<wbr>a65a-=
2ce3c10c60c0%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/00d91d4c-4ee7-4dbd-a547-3dd844f5685d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/00d91d4c-4ee7-4dbd-a547-3dd844f5685d=
%40isocpp.org</a>.<br />
------=_Part_2494_1021269791.1516466168924--
------=_Part_2493_1727009190.1516466168923--
.
Author: Richard Hodges <hodges.r@gmail.com>
Date: Sat, 20 Jan 2018 17:48:16 +0100
Raw View
--94eb2c0b91f0b6b8d0056337f6de
Content-Type: text/plain; charset="UTF-8"
> In your example, the compiler should warn it can't predict the observer -
has no visibility over its lifetime and/or the observed destruction is
behind real time uncertainty.
> He might even suggest alternative like share/weak ptr, because *observe_ptr
was not the right tool in the first place!* The compiler will only reaffirm
that fact.
That would indeed be a useful feature.
On 20 January 2018 at 17:36, <mihailnajdenov@gmail.com> wrote:
>
>
> On Saturday, January 20, 2018 at 4:54:53 PM UTC+2, Richard Hodges wrote:
>>
>> > Copies of observer_ptr still monitor the same address, but with a
>> different scope - their dtor, release or reset.
>>
>> It would be nice if this were enough.
>>
>> consider
>>
>> auto& exec = some_async_executor();
>> auto up = std::make_unique<Foo>();
>>
>> auto p = observer_ptr(up.get());
>> exec.post([p] { something_with(*p); }); // A
>> exec.post([up = std::move(up)] { something_with(*up); }); // B
>> exec.post([p] { something_with(*p); }); // C
>>
>> Assume that B's lambda invocation may or may not complete before C's lambda
>> invocation.
>>
>> I can't see how this could be statically analysed. It's an undetectable
>> logic error, since as far as the compiler is concerned, it has no way of
>> knowing that C's p may outlive B's up.
>>
>> Note that at the point of the construction of each of the 3 lambdas, the
>> pointers captured are all valid (except in the crossing case where there is
>> a context switch after the post at B).
>>
>
>
> In any case this does heap allocation for the views (the lambdas, inside
> the exec class) and presumably threading after that. Both are impossible to
> track.
>
>
> For both however we have nice tools - shared and week ptr.
>
> Which is ironic - the complex code is more safe then the trivial one. Yes
> you could use the heavyweight tools for simple tasks, but that is not zero
> overhead any more.
>
> Static analysis is the tool to help us with the common, simple, yet
> (terribly) unsafe tasks, still keeping zero overhead.
>
>
> Having said that, there are scenarios where tracking will not give
> accurate prediction - the destruction might, for instance, depend upon some
> real time state.
> That is the reason, these cannot be errors, only warnings.
> The compiler should, however, be able to see all paths leading to
> destruction even the once behind real time check/uncertainty and warn that
> "it *might *dangle" or that "no one can be certain, even you!".
>
> In your example, the compiler should warn it can't predict the observer -
> has no visibility over its lifetime and/or the observed destruction is
> behind real time uncertainty.
> He might even suggest alternative like share/weak ptr, because *observe_ptr
> was not the right tool in the first place!* The compiler will only
> reaffirm that fact.
>
>
>
>>
>>
>>
>> On 20 January 2018 at 12:12, <mihailn...@gmail.com> wrote:
>>
>>>
>>>
>>> On Friday, January 19, 2018 at 10:19:40 PM UTC+2, Nicol Bolas wrote:
>>>>
>>>> On Friday, January 19, 2018 at 7:30:52 AM UTC-5, mihailn...@gmail.com
>>>> wrote:
>>>>>
>>>>> Can we "just" define special behavior of observer_ptr (in
>>>>> debug/analyze mode) and solve all cases of lifetime monitoring (under the
>>>>> said limitations) - from smart pointers to function_view?
>>>>>
>>>>
>>>> That's not "behavior" of the type. There is no actual code in
>>>> `observer_ptr` that does anything you're talking about. It's simply a
>>>> compiler or tool that sees you using this particular type and starts
>>>> looking at things because of it.
>>>>
>>>
>>> If the constructor and reset of observer_ptr are decorated with
>>> something like [[debug:observe_destruction]] the behavior of observer_ptr
>>> will be enforced by the compiler.
>>>
>>> The behavior, use and definition of observer_ptr are not changed.
>>>
>>>
>>>>
>>>> It should also be noted that this still doesn't handle perfect
>>>> forwarding. Not unless it is the caller of the function who wraps the
>>>> parameter in an `observer_ptr`.
>>>>
>>>
>>> class A_view
>>> {
>>> A_view(const A* pa) : _p(pa) {}
>>> A_view(const A& a) : _p(&a) {}
>>> A_view(A&& a) : _p(&a) {}
>>>
>>> observer_ptr<const A> _p;
>>> };
>>>
>>> observer_ptr will monitor addressof(*_p) for ~A() call. The scope of
>>> monitoring is ~observer_ptr() or release() call.
>>>
>>> Copies of observer_ptr still monitor the same address, but with a
>>> different scope - their dtor, release or reset.
>>>
>>>
>>> That is a major difference from lifetime extension - we can have
>>> many-to-one mapping without any semantic or implementation problems. Lifetime
>>> extension does not allow copies of a view/ref to extend with the lifetime
>>> of the object.
>>> We are also not limited to initialization only - the monitoring can
>>> (re)start at the call of reset() instead on constructor call only. Lifetime
>>> extension deals with initialization exclusively.
>>>
>>>
>>> How can perfect forwarding interfere in all this?
>>>
>>>
>>> template<typename T, typename ...Args>
>>> auto init(Args&&... arg)
>>> {
>>> return T(std::forward<Args>(arg)...); //< observer_ptr starts
>>> monitoring &arg
>>> }
>>>
>>> int main()
>>> {
>>> auto v = init<A_view>(A{}); //< both A_view and A allocated. A_view
>>> usable before the ';' when ~A is called
>>> }
>>>
>>> If copy elision does not kick-in nothing changes - copy is safe and
>>> defined, lifetime of A is the same.
>>>
>>> If we pass arguments and create A in init() instead ( return
>>> T(A(std::forward<Args>(arg)...)); ), then the observer_ptr is still
>>> created with a valid address,
>>> however, after we return will not be able to use A_view in any way,
>>> including before the ';'.
>>>
>>> If both there is no elision and A is created when initializing T inside
>>> init, then the returned view can be created from a dangling view.
>>> We could allow views from dangling views to be created, however no dtor
>>> will be monitored and all uses of the view will be illegal until
>>> destroyed/reset/release-ed.
>>> We could also issue a warning on coping from dangling view without
>>> problem.
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> 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-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit https://groups.google.com/a/is
>>> ocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-
>>> 2ce3c10c60c0%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0%40isocpp.org?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>> --
> 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/00d91d4c-4ee7-4dbd-
> a547-3dd844f5685d%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/00d91d4c-4ee7-4dbd-a547-3dd844f5685d%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hbdgOOP14o37Wdx5VpuQTS%2BM-%2BMP7GXGbkLeTViiUsHcA%40mail.gmail.com.
--94eb2c0b91f0b6b8d0056337f6de
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">>=C2=A0<span style=3D"font-size:12.8px">In your example=
, the compiler should warn it can't predict the observer - has no visib=
ility over its lifetime and/or the observed destruction is behind real time=
uncertainty.=C2=A0</span><div style=3D"font-size:12.8px">> He might eve=
n suggest alternative like share/weak ptr, because=C2=A0<i>observe_ptr was =
not the right tool in the first place!</i>=C2=A0The compiler will only reaf=
firm that fact.=C2=A0</div><div><br></div><div>That would indeed be a usefu=
l feature.</div><div><br></div></div><div class=3D"gmail_extra"><br><div cl=
ass=3D"gmail_quote">On 20 January 2018 at 17:36, <span dir=3D"ltr"><<a =
href=3D"mailto:mihailnajdenov@gmail.com" target=3D"_blank">mihailnajdenov@g=
mail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><span class=3D""><br><br>On Saturday, January 20, 2018 at 4:54:53 =
PM UTC+2, Richard Hodges wrote:<blockquote class=3D"gmail_quote" style=3D"m=
argin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
dir=3D"ltr">>=C2=A0<span style=3D"font-size:13px">Copies of=C2=A0</span=
><span style=3D"font-size:13px;background-color:transparent;margin:0px;padd=
ing:0px;border:0px rgb(34,34,34)">observer_ptr still monitor the same addre=
ss, but with a different scope - their dtor, release or reset.</span><div><=
span style=3D"font-size:13px;background-color:transparent;margin:0px;paddin=
g:0px;border:0px rgb(34,34,34)"><br></span></div><div><span style=3D"font-s=
ize:13px;background-color:transparent;margin:0px;padding:0px;border:0px rgb=
(34,34,34)">It would be nice if this were enough.</span></div><div><span st=
yle=3D"font-size:13px;background-color:transparent;margin:0px;padding:0px;b=
order:0px rgb(34,34,34)"><br></span></div><div><span style=3D"font-size:13p=
x;background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,=
34)">consider</span></div><div><span style=3D"font-size:13px;background-col=
or:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><br></span>=
</div><div><span style=3D"font-size:13px;background-color:transparent;margi=
n:0px;padding:0px;border:0px rgb(34,34,34)"><font face=3D"monospace, monosp=
ace">auto& exec =3D some_async_executor();</font></span></div><div><spa=
n style=3D"font-size:13px;background-color:transparent;margin:0px;padding:0=
px;border:0px rgb(34,34,34)"><font face=3D"monospace, monospace">auto up =
=3D std::make_unique<Foo>();</font></span></div><div><span style=3D"f=
ont-size:13px;background-color:transparent;margin:0px;padding:0px;border:0p=
x rgb(34,34,34)"><font face=3D"monospace, monospace"><br></font></span></di=
v><div><span style=3D"font-size:13px;background-color:transparent;margin:0p=
x;padding:0px;border:0px rgb(34,34,34)"><font face=3D"monospace, monospace"=
>auto p =3D observer_ptr(up.get());</font></span></div><div><div><span styl=
e=3D"font-size:13px;background-color:transparent;margin:0px;padding:0px;bor=
der:0px rgb(34,34,34)"><font face=3D"monospace, monospace">exec.post([p] { =
something_with(*p); });=C2=A0 =C2=A0 // A</font></span></div></div><div><sp=
an style=3D"background-color:transparent;margin:0px;padding:0px;border:0px =
rgb(34,34,34)"><div style=3D"font-size:small"><span style=3D"font-size:13px=
;background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,3=
4)"><font face=3D"monospace, monospace">exec.post([up =3D std::move(up)] { =
something_with(*up); }); // B</font></span></div></span><div><span style=3D=
"background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,3=
4)"><span style=3D"background-color:transparent;margin:0px;padding:0px;bord=
er:0px rgb(34,34,34)"><div style=3D"font-size:small"><span style=3D"font-si=
ze:13px;background-color:transparent;margin:0px;padding:0px;border:0px rgb(=
34,34,34)"><font face=3D"monospace, monospace">exec.post([p] { something_wi=
th(*p); });=C2=A0 =C2=A0// C</font></span></div><div style=3D"font-size:sma=
ll"><span style=3D"font-size:13px;background-color:transparent;margin:0px;p=
adding:0px;border:0px rgb(34,34,34)"><br></span></div><div>Assume that B=
9;s lambda invocation may or may not complete before C's=C2=A0<span sty=
le=3D"background-color:transparent">lambda invocation</span><span style=3D"=
background-color:transparent">.</span></div><div style=3D"font-size:small">=
<span style=3D"font-size:13px;background-color:transparent;margin:0px;paddi=
ng:0px;border:0px rgb(34,34,34)"><br></span></div><div style=3D"font-size:s=
mall"><span style=3D"font-size:13px;background-color:transparent;margin:0px=
;padding:0px;border:0px rgb(34,34,34)">I can't see how this could be st=
atically analysed. It's an undetectable logic error, since as far as th=
e compiler is concerned, it has no way of knowing that C's <font face=
=3D"monospace, monospace">p</font> may outlive B's <font face=3D"monosp=
ace, monospace">up</font>.</span></div><div style=3D"font-size:small"><span=
style=3D"font-size:13px;background-color:transparent;margin:0px;padding:0p=
x;border:0px rgb(34,34,34)"><br></span></div></span></span><div style=3D"fo=
nt-size:13px"><span style=3D"background-color:transparent;margin:0px;paddin=
g:0px;border:0px rgb(34,34,34)"><span style=3D"background-color:transparent=
;margin:0px;padding:0px;border:0px rgb(34,34,34)"><span style=3D"font-size:=
13px;background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,=
34,34)">Note that at the point of the construction of each of the 3 lambdas=
, the pointers captured are all valid (except in the crossing case where th=
ere is a context switch after the post at B).</span></span></span></div></d=
iv></div></div></blockquote><div><br></div><div><br></div></span><div>In an=
y case this does heap allocation for the views (the lambdas, inside the exe=
c class) and presumably threading after that. Both are impossible to track.=
</div><div><br></div><div><br></div><div>For both however we have nice too=
ls - shared and week ptr.=C2=A0</div><div><br></div><div>Which is ironic - =
the complex code is more safe then the trivial one. Yes you could use the h=
eavyweight tools for simple tasks, but that is not zero overhead any more.=
=C2=A0</div><div><br></div><div>Static analysis is the tool to help us with=
the common, simple, yet (terribly) unsafe tasks, still keeping zero overhe=
ad.</div><div><br></div><div><br></div><div>Having said that, there are sce=
narios where tracking will not give accurate prediction - the destruction m=
ight, for instance, depend upon some real time state.</div><div>That is the=
reason, these cannot be errors, only warnings.</div><div>The compiler shou=
ld, however, be able to see all paths leading to destruction even the once =
behind real time check/uncertainty and warn that "it <i>might </i>dang=
le" or that "no one can be certain, even you!".</div><div><b=
r></div><div>In your example, the compiler should warn it can't predict=
the observer - has no visibility over its lifetime and/or the observed des=
truction is behind real time uncertainty.=C2=A0<b><i></i></b></div><div>He =
might even suggest alternative like share/weak ptr, because <i>observe_ptr =
was not the right tool in the first place!</i> The compiler will only reaff=
irm that fact.=C2=A0</div><div><br></div><div>=C2=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div><span style=3D"background-colo=
r:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><div><span s=
tyle=3D"background-color:transparent;margin:0px;padding:0px;border:0px rgb(=
34,34,34)"><div style=3D"font-size:13px"><span style=3D"font-size:13px;back=
ground-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,34)"><=
br></span></div><div style=3D"font-size:13px"><span style=3D"font-size:13px=
;background-color:transparent;margin:0px;padding:0px;border:0px rgb(34,34,3=
4)"><br></span></div></span></div></span></div></div><div><br><div class=3D=
"gmail_quote"><div><div class=3D"h5">On 20 January 2018 at 12:12, <span di=
r=3D"ltr"><<a rel=3D"nofollow">mihailn...@gmail.com</a>></span> wrote=
:<br></div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=3D"h5"><div=
dir=3D"ltr"><span><br><br>On Friday, January 19, 2018 at 10:19:40 PM UTC+2=
, Nicol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
">On Friday, January 19, 2018 at 7:30:52 AM UTC-5, <a>mihailn...@gmail.com<=
/a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0=
..8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><fo=
nt face=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb(34,34=
,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13=
px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:no=
ne;word-spacing:0px;display:inline!important;white-space:normal;float:none;=
background-color:transparent">Can we <span style=3D"display:inline!importan=
t;float:none;background-color:transparent;color:rgb(34,34,34);font-family:a=
rial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-w=
eight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-i=
ndent:0px;text-transform:none;white-space:normal;word-spacing:0px">"ju=
st" </span>define special behavior of=C2=A0<span style=3D"background-c=
olor:transparent;border-bottom-color:rgb(34,34,34);border-bottom-style:none=
;border-bottom-width:0px;border-left-color:rgb(34,34,34);border-left-style:=
none;border-left-width:0px;border-right-color:rgb(34,34,34);border-right-st=
yle:none;border-right-width:0px;border-top-color:rgb(34,34,34);border-top-s=
tyle:none;border-top-width:0px;color:rgb(34,34,34);display:inline;float:non=
e;font-family:arial,sans-serif;font-size:13px;font-style:normal;font-varian=
t:normal;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-lef=
t:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;p=
adding-right:0px;padding-top:0px;text-align:left;text-decoration:none;text-=
indent:0px;text-transform:none;white-space:normal;word-spacing:0px">observe=
r_ptr (in debug/analyze mode) and solve all cases of lifetime monitoring (u=
nder the said limitations) - from smart pointers to function_view?</span></=
span></font></div></div></blockquote><div><br></div><div>That's not &qu=
ot;behavior" of the type. There is no actual code in `observer_ptr` th=
at does anything you're talking about. It's simply a compiler or to=
ol that sees you using this particular type and starts looking at things be=
cause of it.</div></div></blockquote><div><br></div></span><div>If the cons=
tructor and reset of <span style=3D"display:inline!important;float:none;bac=
kground-color:transparent;color:rgb(34,34,34);font-family:"Arial"=
,"Helvetica",sans-serif;font-size:13px;font-style:normal;font-var=
iant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-deco=
ration:none;text-indent:0px;text-transform:none;white-space:normal;word-spa=
cing:0px">observer_ptr are decorated with something like<font face=3D"couri=
er new,monospace"> [[debug:observe_destruction]] </font>the=C2=A0<span styl=
e=3D"display:inline!important;float:none;background-color:transparent;color=
:rgb(34,34,34);font-family:"Arial","Helvetica",sans-ser=
if;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;let=
ter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;tex=
t-transform:none;white-space:normal;word-spacing:0px">behavior of=C2=A0<spa=
n>observer_ptr will be enforced by the compiler. </span></span></span></div=
><div><span style=3D"display:inline!important;float:none;background-color:t=
ransparent;color:rgb(34,34,34);font-family:"Arial","Helvetic=
a",sans-serif;font-size:13px;font-style:normal;font-variant:normal;fon=
t-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;tex=
t-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span=
style=3D"display:inline!important;float:none;background-color:transparent;=
color:rgb(34,34,34);font-family:"Arial","Helvetica",san=
s-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:40=
0;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0p=
x;text-transform:none;white-space:normal;word-spacing:0px"><span><br></span=
></span></span></div><div><span style=3D"display:inline!important;float:non=
e;background-color:transparent;color:rgb(34,34,34);font-family:"Arial&=
quot;,"Helvetica",sans-serif;font-size:13px;font-style:normal;fon=
t-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text=
-decoration:none;text-indent:0px;text-transform:none;white-space:normal;wor=
d-spacing:0px"><span style=3D"display:inline!important;float:none;backgroun=
d-color:transparent;color:rgb(34,34,34);font-family:"Arial","=
;Helvetica",sans-serif;font-size:13px;font-style:normal;font-variant:n=
ormal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration=
:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px"><span>The behavior, use and definition of observer_ptr are not changed.=
=C2=A0</span></span></span></div><span><div>=C2=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div><br></div><div>It should also =
be noted that this still doesn't handle perfect forwarding. Not unless =
it is the caller of the function who wraps the parameter in an `observer_pt=
r`.</div></div></blockquote><div><br></div></span><div><font face=3D"courie=
r new,monospace">class A_view</font></div><div><font face=3D"courier new,mo=
nospace">{</font></div><div><font face=3D"courier new,monospace">=C2=A0 </f=
ont><font face=3D"courier new,monospace"><span style=3D"text-align:left;col=
or:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;=
font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-d=
ecoration:none;word-spacing:0px;display:inline!important;white-space:normal=
;float:none;background-color:transparent">A_view(const A* pa) : _p(pa) {}</=
span></font></div><div><font face=3D"courier new,monospace">=C2=A0 <span st=
yle=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:=
0px;letter-spacing:normal;font-size:13px;font-style:normal;font-variant:nor=
mal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline!im=
portant;white-space:normal;float:none;background-color:transparent"><span>A=
_view(const A& a) : _p(&a) {}</span></span></font></div><div><font =
face=3D"courier new,monospace">=C2=A0 <span style=3D"text-align:left;color:=
rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;fon=
t-size:13px;font-variant:normal;word-spacing:0px;display:inline!important;w=
hite-space:normal;float:none;background-color:transparent"><span style=3D"m=
argin:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(34=
,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-size=
:13px;font-variant:normal;word-spacing:0px;display:inline;white-space:norma=
l;float:none;background-color:transparent"><span>A_view(A&& a) : _p=
(&a) {}</span></span></span></font></div><div><span style=3D"text-align=
:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacin=
g:normal;font-size:13px;font-variant:normal;word-spacing:0px;display:inline=
!important;white-space:normal;float:none;background-color:transparent"><spa=
n style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;=
color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:norm=
al;font-size:13px;font-variant:normal;word-spacing:0px;display:inline;white=
-space:normal;float:none;background-color:transparent"><span><font face=3D"=
courier new,monospace"><br></font></span></span></span></div><div><font fac=
e=3D"courier new,monospace">=C2=A0 <span style=3D"text-align:left;color:rgb=
(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-s=
ize:13px;font-variant:normal;word-spacing:0px;display:inline!important;whit=
e-space:normal;float:none;background-color:transparent"><span style=3D"marg=
in:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34=
,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13=
px;font-variant:normal;word-spacing:0px;display:inline;white-space:normal;f=
loat:none;background-color:transparent"><span>observer_ptr<const A> _=
p;</span><b></b></span></span></font></div><div><font face=3D"courier new,m=
onospace">};=C2=A0</font></div><div><font face=3D"courier new"><br></font><=
/div><div><font face=3D"arial,sans-serif">observer_ptr will monitor address=
of(*_p) for ~A() call. The scope of monitoring is ~<span style=3D"text-alig=
n:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spaci=
ng:normal;font-size:13px;font-style:normal;font-variant:normal;font-weight:=
400;text-decoration:none;word-spacing:0px;display:inline!important;white-sp=
ace:normal;float:none;background-color:transparent">observer_ptr() or relea=
se() call.</span></font></div><div><font face=3D"arial,sans-serif"><span st=
yle=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:=
0px;letter-spacing:normal;font-size:13px;font-style:normal;font-variant:nor=
mal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline!im=
portant;white-space:normal;float:none;background-color:transparent"><br></s=
pan></font></div><div><font face=3D"arial,sans-serif"><span style=3D"text-a=
lign:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-sp=
acing:normal;font-size:13px;font-style:normal;font-variant:normal;font-weig=
ht:400;text-decoration:none;word-spacing:0px;display:inline!important;white=
-space:normal;float:none;background-color:transparent">Copies of=C2=A0<span=
style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-align:left;c=
olor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:norma=
l;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;text=
-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:n=
one;background-color:transparent"><span style=3D"background-color:transpare=
nt;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom=
-width:0px;border-left-color:rgb(34,34,34);border-left-style:none;border-le=
ft-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;borde=
r-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;bord=
er-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13=
px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:nor=
mal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;paddi=
ng-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align=
:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:=
normal;word-spacing:0px"><span style=3D"background-color:transparent;border=
-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0p=
x;border-left-color:rgb(34,34,34);border-left-style:none;border-left-width:=
0px;border-right-color:rgb(34,34,34);border-right-style:none;border-right-w=
idth:0px;border-top-color:rgb(34,34,34);border-top-style:none;border-top-wi=
dth:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;font-s=
tyle:normal;font-variant:normal;font-weight:400;letter-spacing:normal;margi=
n-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom=
:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:left;tex=
t-decoration:none;text-indent:0px;text-transform:none;white-space:normal;wo=
rd-spacing:0px"><font face=3D"arial,sans-serif">observer_ptr still monitor =
the same address, but with a different scope - their dtor, release or reset=
..</font></span></span></span></span></font><font face=3D"arial,sans-serif">=
<span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text=
-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-var=
iant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:i=
nline!important;white-space:normal;float:none;background-color:transparent"=
><span style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-align:=
left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing=
:normal;font-size:13px;font-style:normal;font-variant:normal;font-weight:40=
0;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;f=
loat:none;background-color:transparent"><span style=3D"background-color:tra=
nsparent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-=
bottom-width:0px;border-left-color:rgb(34,34,34);border-left-style:none;bor=
der-left-width:0px;border-right-color:rgb(34,34,34);border-right-style:none=
;border-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:non=
e;border-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-s=
ize:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spaci=
ng:normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px=
;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text=
-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-=
space:normal;word-spacing:0px"><span style=3D"background-color:transparent;=
border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bottom-wi=
dth:0px;border-left-color:rgb(34,34,34);border-left-style:none;border-left-=
width:0px;border-right-color:rgb(34,34,34);border-right-style:none;border-r=
ight-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;border-=
top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size:13px;=
font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal=
;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-=
bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-align:le=
ft;text-decoration:none;text-indent:0px;text-transform:none;white-space:nor=
mal;word-spacing:0px"></span></span></span></span></font></div><div><font f=
ace=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb(34,34,34)=
;text-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;f=
ont-style:normal;font-variant:normal;font-weight:400;text-decoration:none;w=
ord-spacing:0px;display:inline!important;white-space:normal;float:none;back=
ground-color:transparent"><span style=3D"margin:0px;padding:0px;border:0px =
rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:none;text-=
indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;font-vari=
ant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:in=
line;white-space:normal;float:none;background-color:transparent"><span styl=
e=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);border-=
bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);b=
order-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,34=
);border-right-style:none;border-right-width:0px;border-top-color:rgb(34,34=
,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);display=
:inline;float:none;font-size:13px;font-style:normal;font-variant:normal;fon=
t-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin=
-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right=
:0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px;t=
ext-transform:none;white-space:normal;word-spacing:0px"><span style=3D"back=
ground-color:transparent;border-bottom-color:rgb(34,34,34);border-bottom-st=
yle:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);border-lef=
t-style:none;border-left-width:0px;border-right-color:rgb(34,34,34);border-=
right-style:none;border-right-width:0px;border-top-color:rgb(34,34,34);bord=
er-top-style:none;border-top-width:0px;color:rgb(34,34,34);display:inline;f=
loat:none;font-size:13px;font-style:normal;font-variant:normal;font-weight:=
400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margin-right:0p=
x;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;padd=
ing-top:0px;text-align:left;text-decoration:none;text-indent:0px;text-trans=
form:none;white-space:normal;word-spacing:0px"><br></span></span></span></s=
pan></font></div><font face=3D"arial,sans-serif"><span style=3D"text-align:=
left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing=
:normal;font-size:13px;font-style:normal;font-variant:normal;font-weight:40=
0;text-decoration:none;word-spacing:0px;display:inline!important;white-spac=
e:normal;float:none;background-color:transparent"><span style=3D"margin:0px=
;padding:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);t=
ext-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;fon=
t-style:normal;font-variant:normal;font-weight:400;text-decoration:none;wor=
d-spacing:0px;display:inline;white-space:normal;float:none;background-color=
:transparent"><span style=3D"background-color:transparent;border-bottom-col=
or:rgb(34,34,34);border-bottom-style:none;border-bottom-width:0px;border-le=
ft-color:rgb(34,34,34);border-left-style:none;border-left-width:0px;border-=
right-color:rgb(34,34,34);border-right-style:none;border-right-width:0px;bo=
rder-top-color:rgb(34,34,34);border-top-style:none;border-top-width:0px;col=
or:rgb(34,34,34);display:inline;float:none;font-size:13px;font-style:normal=
;font-variant:normal;font-weight:400;letter-spacing:normal;margin-bottom:0p=
x;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;paddin=
g-left:0px;padding-right:0px;padding-top:0px;text-align:left;text-decoratio=
n:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:=
0px"><span style=3D"background-color:transparent;border-bottom-color:rgb(34=
,34,34);border-bottom-style:none;border-bottom-width:0px;border-left-color:=
rgb(34,34,34);border-left-style:none;border-left-width:0px;border-right-col=
or:rgb(34,34,34);border-right-style:none;border-right-width:0px;border-top-=
color:rgb(34,34,34);border-top-style:none;border-top-width:0px;color:rgb(34=
,34,34);display:inline;float:none;font-size:13px;font-style:normal;font-var=
iant:normal;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-=
left:0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0p=
x;padding-right:0px;padding-top:0px;text-align:left;text-decoration:none;te=
xt-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div=
><br></div></span></span></span></span></font><div><font face=3D"arial,sans=
-serif"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:n=
one;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;=
font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;d=
isplay:inline!important;white-space:normal;float:none;background-color:tran=
sparent"><span style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);tex=
t-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter=
-spacing:normal;font-size:13px;font-style:normal;font-variant:normal;font-w=
eight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:=
normal;float:none;background-color:transparent"><span style=3D"background-c=
olor:transparent;border-bottom-color:rgb(34,34,34);border-bottom-style:none=
;border-bottom-width:0px;border-left-color:rgb(34,34,34);border-left-style:=
none;border-left-width:0px;border-right-color:rgb(34,34,34);border-right-st=
yle:none;border-right-width:0px;border-top-color:rgb(34,34,34);border-top-s=
tyle:none;border-top-width:0px;color:rgb(34,34,34);display:inline;float:non=
e;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;lett=
er-spacing:normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin=
-top:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:=
0px;text-align:left;text-decoration:none;text-indent:0px;text-transform:non=
e;white-space:normal;word-spacing:0px"><span style=3D"background-color:tran=
sparent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-b=
ottom-width:0px;border-left-color:rgb(34,34,34);border-left-style:none;bord=
er-left-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;=
border-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none=
;border-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-si=
ze:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacin=
g:normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;=
padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-=
align:left;text-decoration:none;text-indent:0px;text-transform:none;white-s=
pace:normal;word-spacing:0px">That is a major difference from lifetime exte=
nsion - we can have many-to-one mapping without any semantic or implementat=
ion problems.=C2=A0<span style=3D"display:inline!important;float:none;backg=
round-color:transparent;color:rgb(34,34,34);font-family:arial,sans-serif;fo=
nt-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter-s=
pacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-tra=
nsform:none;white-space:normal;word-spacing:0px">Lifetime extension does no=
t allow copies of a view/ref to extend with the lifetime of the object.</sp=
an></span></span></span></span></font></div><div><font face=3D"arial,sans-s=
erif"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:non=
e;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;fo=
nt-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;dis=
play:inline!important;white-space:normal;float:none;background-color:transp=
arent"><span style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-=
align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-s=
pacing:normal;font-size:13px;font-style:normal;font-variant:normal;font-wei=
ght:400;text-decoration:none;word-spacing:0px;display:inline;white-space:no=
rmal;float:none;background-color:transparent"><span style=3D"background-col=
or:transparent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;b=
order-bottom-width:0px;border-left-color:rgb(34,34,34);border-left-style:no=
ne;border-left-width:0px;border-right-color:rgb(34,34,34);border-right-styl=
e:none;border-right-width:0px;border-top-color:rgb(34,34,34);border-top-sty=
le:none;border-top-width:0px;color:rgb(34,34,34);display:inline;float:none;=
font-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter=
-spacing:normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-t=
op:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0p=
x;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;=
white-space:normal;word-spacing:0px"><span style=3D"background-color:transp=
arent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bot=
tom-width:0px;border-left-color:rgb(34,34,34);border-left-style:none;border=
-left-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;bo=
rder-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;b=
order-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size=
:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:=
normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;pa=
dding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-al=
ign:left;text-decoration:none;text-indent:0px;text-transform:none;white-spa=
ce:normal;word-spacing:0px">We are also not limited to initialization only =
- the monitoring can (re)start at the call of reset() instead on constructo=
r call only. Lifetime extension deals with initialization exclusively.=C2=
=A0</span></span></span></span></font></div><div><font face=3D"arial,sans-s=
erif"><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:non=
e;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal;fo=
nt-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;dis=
play:inline!important;white-space:normal;float:none;background-color:transp=
arent"><span style=3D"margin:0px;padding:0px;border:0px rgb(34,34,34);text-=
align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-s=
pacing:normal;font-size:13px;font-style:normal;font-variant:normal;font-wei=
ght:400;text-decoration:none;word-spacing:0px;display:inline;white-space:no=
rmal;float:none;background-color:transparent"><span style=3D"background-col=
or:transparent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;b=
order-bottom-width:0px;border-left-color:rgb(34,34,34);border-left-style:no=
ne;border-left-width:0px;border-right-color:rgb(34,34,34);border-right-styl=
e:none;border-right-width:0px;border-top-color:rgb(34,34,34);border-top-sty=
le:none;border-top-width:0px;color:rgb(34,34,34);display:inline;float:none;=
font-size:13px;font-style:normal;font-variant:normal;font-weight:400;letter=
-spacing:normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-t=
op:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0p=
x;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;=
white-space:normal;word-spacing:0px"><span style=3D"background-color:transp=
arent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bot=
tom-width:0px;border-left-color:rgb(34,34,34);border-left-style:none;border=
-left-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;bo=
rder-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;b=
order-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-size=
:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:=
normal;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;pa=
dding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-al=
ign:left;text-decoration:none;text-indent:0px;text-transform:none;white-spa=
ce:normal;word-spacing:0px"><br></span></span></span></span></font></div><d=
iv><font face=3D"arial,sans-serif"><span style=3D"text-align:left;color:rgb=
(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-s=
ize:13px;font-style:normal;font-variant:normal;font-weight:400;text-decorat=
ion:none;word-spacing:0px;display:inline!important;white-space:normal;float=
:none;background-color:transparent"><span style=3D"margin:0px;padding:0px;b=
order:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:=
none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:normal=
;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;=
display:inline;white-space:normal;float:none;background-color:transparent">=
<span style=3D"background-color:transparent;border-bottom-color:rgb(34,34,3=
4);border-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(3=
4,34,34);border-left-style:none;border-left-width:0px;border-right-color:rg=
b(34,34,34);border-right-style:none;border-right-width:0px;border-top-color=
:rgb(34,34,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,3=
4);display:inline;float:none;font-size:13px;font-style:normal;font-variant:=
normal;font-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:=
0px;margin-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;pad=
ding-right:0px;padding-top:0px;text-align:left;text-decoration:none;text-in=
dent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span sty=
le=3D"background-color:transparent;border-bottom-color:rgb(34,34,34);border=
-bottom-style:none;border-bottom-width:0px;border-left-color:rgb(34,34,34);=
border-left-style:none;border-left-width:0px;border-right-color:rgb(34,34,3=
4);border-right-style:none;border-right-width:0px;border-top-color:rgb(34,3=
4,34);border-top-style:none;border-top-width:0px;color:rgb(34,34,34);displa=
y:inline;float:none;font-size:13px;font-style:normal;font-variant:normal;fo=
nt-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;margi=
n-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-righ=
t:0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px;=
text-transform:none;white-space:normal;word-spacing:0px"><br></span></span>=
</span></span></font></div><div>How can perfect forwarding interfere in all=
this?=C2=A0</div><div><br></div><div><br></div><div><font face=3D"courier =
new,monospace"><span>template<typename T, typename ...Args><br></span=
>auto init(Args&&... arg)<br>{<br>=C2=A0 return T(std::forward<A=
rgs>(arg)...); //< observer_ptr starts monitoring &arg<br>}<br><b=
r>int main()<br>{ <br>=C2=A0 auto v =3D init<A_view>(A{}); //< bot=
h A_view and A allocated. A_view usable before the ';' when ~A is c=
alled<br>}</font></div><div><font face=3D"courier new"><br></font></div><di=
v>If copy elision does not kick-in nothing changes - copy is safe and defin=
ed, lifetime of A is the same.</div><div><br></div><div>If we pass argument=
s and create A in init() instead ( <font face=3D"courier new,monospace">ret=
urn</font>=C2=A0 <span style=3D"display:inline!important;float:none;backgro=
und-color:transparent;color:rgb(34,34,34);font-family:courier new,monospace=
;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;lette=
r-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-=
transform:none;white-space:normal;word-spacing:0px">T(A(std::forward<Arg=
s>(arg)...<wbr>)); </span>), then the <font face=3D"courier new,monospac=
e">observer_ptr </font>is still created with a valid address, </div><div>ho=
wever, after we return will not be able to use<font face=3D"courier new,mon=
ospace"> A_view</font> in any way, including before the <font face=3D"couri=
er new,monospace">';'.=C2=A0</font></div><div><b></b><i></i><u></u>=
<sub></sub><sup></sup><strike></strike><font face=3D"courier new,monospace"=
><br></font></div><div>If both there is no elision and A is created when in=
itializing T inside init, then the returned view can be created from a dang=
ling view.=C2=A0</div><div>We could allow views from dangling views to be c=
reated, however=C2=A0<span style=3D"display:inline!important;float:none;bac=
kground-color:transparent;color:rgb(34,34,34);font-family:"Arial"=
,"Helvetica",sans-serif;font-size:13px;font-style:normal;font-var=
iant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-deco=
ration:none;text-indent:0px;text-transform:none;white-space:normal;word-spa=
cing:0px">no dtor will be monitored and</span> all uses of the view will be=
illegal until destroyed/reset/release-ed. </div><div>We could also issue a=
warning on coping from dangling view without problem.</div><div><br></div>=
<div><br></div><div><br></div><div><font face=3D"arial,sans-serif"><b><i><b=
r></i></b></font></div><div>=C2=A0</div></div></div></div><span><div><div c=
lass=3D"h5">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br></div></div>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</a>.<br></span><span class=3D"">
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/4fa792ec-1f51-4357-a65a-2ce3c10c60c0%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank">https://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-pr=
oposals<wbr>/4fa792ec-1f51-4357-a65a-<wbr>2ce3c10c60c0%40isocpp.org</a>.<br=
>
</span></blockquote></div><br></div>
</blockquote></div><span class=3D"">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/00d91d4c-4ee7-4dbd-a547-3dd844f5685d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/00d9=
1d4c-4ee7-4dbd-<wbr>a547-3dd844f5685d%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALvx3hbdgOOP14o37Wdx5VpuQTS%2BM-%2BM=
P7GXGbkLeTViiUsHcA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3hbdgOOP=
14o37Wdx5VpuQTS%2BM-%2BMP7GXGbkLeTViiUsHcA%40mail.gmail.com</a>.<br />
--94eb2c0b91f0b6b8d0056337f6de--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sat, 20 Jan 2018 11:31:21 -0800 (PST)
Raw View
------=_Part_3058_1799439253.1516476681966
Content-Type: multipart/alternative;
boundary="----=_Part_3059_105007333.1516476681966"
------=_Part_3059_105007333.1516476681966
Content-Type: text/plain; charset="UTF-8"
On Saturday, January 20, 2018 at 6:12:09 AM UTC-5, mihailn...@gmail.com
wrote:
>
>
>
> On Friday, January 19, 2018 at 10:19:40 PM UTC+2, Nicol Bolas wrote:
>>
>> On Friday, January 19, 2018 at 7:30:52 AM UTC-5, mihailn...@gmail.com
>> wrote:
>>>
>>> Can we "just" define special behavior of observer_ptr (in debug/analyze
>>> mode) and solve all cases of lifetime monitoring (under the said
>>> limitations) - from smart pointers to function_view?
>>>
>>
>> That's not "behavior" of the type. There is no actual code in
>> `observer_ptr` that does anything you're talking about. It's simply a
>> compiler or tool that sees you using this particular type and starts
>> looking at things because of it.
>>
>
> If the constructor and reset of observer_ptr are decorated with something
> like [[debug:observe_destruction]] the behavior of observer_ptr will be
> enforced by the compiler.
>
> The behavior, use and definition of observer_ptr are not changed.
>
>
>>
>> It should also be noted that this still doesn't handle perfect
>> forwarding. Not unless it is the caller of the function who wraps the
>> parameter in an `observer_ptr`.
>>
>
> class A_view
> {
> A_view(const A* pa) : _p(pa) {}
> A_view(const A& a) : _p(&a) {}
> A_view(A&& a) : _p(&a) {}
>
> observer_ptr<const A> _p;
> };
>
> observer_ptr will monitor addressof(*_p) for ~A() call.
>
How would it know? If all the compiler in that translation unit sees is:
class A_view
{
public:
A_view(const A &p);
private:
observer_ptr<A> p_;
};
How could the compiler* possibly* know that this code is invalid:
A_view v(A{});
We're not talking about runtime detection here; this is purely
compile-time. And the compiler doesn't necessarily see everything. If
`A_view` is in another translation unit that isn't visible to static
analysis, this doesn't work.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/634a78e7-dc92-4f5e-9105-83339a18b579%40isocpp.org.
------=_Part_3059_105007333.1516476681966
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Saturday, January 20, 2018 at 6:12:09 AM UTC-5, mihailn=
....@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><br><br>On Friday, January 19, 2018 at 10:19:40 PM UTC+2, Nicol Bo=
las wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0=
..8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Frida=
y, January 19, 2018 at 7:30:52 AM UTC-5, <a>mihailn...@gmail.com</a> wrote:=
<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><font face=3D=
"arial,sans-serif"><span style=3D"text-align:left;color:rgb(34,34,34);text-=
transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-st=
yle:normal;font-variant:normal;font-weight:400;text-decoration:none;word-sp=
acing:0px;display:inline!important;white-space:normal;float:none;background=
-color:transparent">Can we <span style=3D"display:inline!important;float:no=
ne;background-color:transparent;color:rgb(34,34,34);font-family:arial,sans-=
serif;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;=
letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;=
text-transform:none;white-space:normal;word-spacing:0px">"just" <=
/span>define special behavior of=C2=A0<span style=3D"background-color:trans=
parent;border-bottom-color:rgb(34,34,34);border-bottom-style:none;border-bo=
ttom-width:0px;border-left-color:rgb(34,34,34);border-left-style:none;borde=
r-left-width:0px;border-right-color:rgb(34,34,34);border-right-style:none;b=
order-right-width:0px;border-top-color:rgb(34,34,34);border-top-style:none;=
border-top-width:0px;color:rgb(34,34,34);display:inline;float:none;font-fam=
ily:arial,sans-serif;font-size:13px;font-style:normal;font-variant:normal;f=
ont-weight:400;letter-spacing:normal;margin-bottom:0px;margin-left:0px;marg=
in-right:0px;margin-top:0px;padding-bottom:0px;padding-left:0px;padding-rig=
ht:0px;padding-top:0px;text-align:left;text-decoration:none;text-indent:0px=
;text-transform:none;white-space:normal;word-spacing:0px">observer_ptr (in =
debug/analyze mode) and solve all cases of lifetime monitoring (under the s=
aid limitations) - from smart pointers to function_view?</span></span></fon=
t></div></div></blockquote><div><br></div><div>That's not "behavio=
r" of the type. There is no actual code in `observer_ptr` that does an=
ything you're talking about. It's simply a compiler or tool that se=
es you using this particular type and starts looking at things because of i=
t.</div></div></blockquote><div><br></div><div>If the constructor and reset=
of <span style=3D"display:inline!important;float:none;background-color:tra=
nsparent;color:rgb(34,34,34);font-family:"Arial","Helvetica&=
quot;,sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-=
weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-=
indent:0px;text-transform:none;white-space:normal;word-spacing:0px">observe=
r_ptr are decorated with something like<font face=3D"courier new,monospace"=
> [[debug:observe_destruction]] </font>the=C2=A0<span style=3D"display:inli=
ne!important;float:none;background-color:transparent;color:rgb(34,34,34);fo=
nt-family:"Arial","Helvetica",sans-serif;font-size:13px=
;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:norma=
l;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;=
white-space:normal;word-spacing:0px">behavior of=C2=A0<span>observer_ptr wi=
ll be enforced by the compiler. </span></span></span></div><div><span style=
=3D"display:inline!important;float:none;background-color:transparent;color:=
rgb(34,34,34);font-family:"Arial","Helvetica",sans-seri=
f;font-size:13px;font-style:normal;font-variant:normal;font-weight:400;lett=
er-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text=
-transform:none;white-space:normal;word-spacing:0px"><span style=3D"display=
:inline!important;float:none;background-color:transparent;color:rgb(34,34,3=
4);font-family:"Arial","Helvetica",sans-serif;font-size=
:13px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:=
normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:=
none;white-space:normal;word-spacing:0px"><span><br></span></span></span></=
div><div><span style=3D"display:inline!important;float:none;background-colo=
r:transparent;color:rgb(34,34,34);font-family:"Arial","Helve=
tica",sans-serif;font-size:13px;font-style:normal;font-variant:normal;=
font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;=
text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><s=
pan style=3D"display:inline!important;float:none;background-color:transpare=
nt;color:rgb(34,34,34);font-family:"Arial","Helvetica",=
sans-serif;font-size:13px;font-style:normal;font-variant:normal;font-weight=
:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent=
:0px;text-transform:none;white-space:normal;word-spacing:0px"><span>The beh=
avior, use and definition of observer_ptr are not changed. =C2=A0</span></s=
pan></span></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div dir=3D"ltr"><div><br></div><div>It should also be noted that this sti=
ll doesn't handle perfect forwarding. Not unless it is the caller of th=
e function who wraps the parameter in an `observer_ptr`.</div></div></block=
quote><div><br></div><div><font face=3D"courier new,monospace">class A_view=
</font></div><div><font face=3D"courier new,monospace">{</font></div><div><=
font face=3D"courier new,monospace">=C2=A0 </font><font face=3D"courier new=
,monospace"><span style=3D"text-align:left;color:rgb(34,34,34);text-transfo=
rm:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-style:nor=
mal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0=
px;display:inline!important;white-space:normal;float:none;background-color:=
transparent">A_view(const A* pa) : _p(pa) {}</span></font></div><div><font =
face=3D"courier new,monospace">=C2=A0 <span style=3D"text-align:left;color:=
rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;fon=
t-size:13px;font-style:normal;font-variant:normal;font-weight:400;text-deco=
ration:none;word-spacing:0px;display:inline!important;white-space:normal;fl=
oat:none;background-color:transparent"><span>A_view(const A& a) : _p(&a=
mp;a) {}</span></span></font></div><div><font face=3D"courier new,monospace=
">=C2=A0 <span style=3D"text-align:left;color:rgb(34,34,34);text-transform:=
none;text-indent:0px;letter-spacing:normal;font-size:13px;font-variant:norm=
al;word-spacing:0px;display:inline!important;white-space:normal;float:none;=
background-color:transparent"><span style=3D"margin:0px;padding:0px;border:=
0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:none;t=
ext-indent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;wor=
d-spacing:0px;display:inline;white-space:normal;float:none;background-color=
:transparent"><span>A_view(A&& a) : _p(&a) {}</span></span></sp=
an></font></div><div><span style=3D"text-align:left;color:rgb(34,34,34);tex=
t-transform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-=
variant:normal;word-spacing:0px;display:inline!important;white-space:normal=
;float:none;background-color:transparent"><span style=3D"margin:0px;padding=
:0px;border:0px rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-tran=
sform:none;text-indent:0px;letter-spacing:normal;font-size:13px;font-varian=
t:normal;word-spacing:0px;display:inline;white-space:normal;float:none;back=
ground-color:transparent"><span><font face=3D"courier new,monospace"><br></=
font></span></span></span></div><div><font face=3D"courier new,monospace">=
=C2=A0 <span style=3D"text-align:left;color:rgb(34,34,34);text-transform:no=
ne;text-indent:0px;letter-spacing:normal;font-size:13px;font-variant:normal=
;word-spacing:0px;display:inline!important;white-space:normal;float:none;ba=
ckground-color:transparent"><span style=3D"margin:0px;padding:0px;border:0p=
x rgb(34,34,34);text-align:left;color:rgb(34,34,34);text-transform:none;tex=
t-indent:0px;letter-spacing:normal;font-size:13px;font-variant:normal;word-=
spacing:0px;display:inline;white-space:normal;float:none;background-color:t=
ransparent"><span>observer_ptr<const A> _p;</span><b></b></span></spa=
n></font></div><div><font face=3D"courier new,monospace">};=C2=A0</font></d=
iv><div><font face=3D"courier new"><br></font></div><div><font face=3D"aria=
l,sans-serif">observer_ptr will monitor addressof(*_p) for ~A() call.</font=
></div></div></blockquote><div><br></div><div>How would it know? If all the=
compiler in that translation unit sees is:</div><div><br></div><div class=
=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: =
break-word; background-color: rgb(250, 250, 250);"><code class=3D"prettypri=
nt"><div class=3D"subprettyprint"><span class=3D"styled-by-prettify" style=
=3D"color: #008;">class</span><span class=3D"styled-by-prettify" style=3D"c=
olor: #000;"> A_view<br></span><span class=3D"styled-by-prettify" style=3D"=
color: #660;">{</span><span class=3D"styled-by-prettify" style=3D"color: #0=
00;"><br></span><span class=3D"styled-by-prettify" style=3D"color: #008;">p=
ublic</span><span class=3D"styled-by-prettify" style=3D"color: #660;">:</sp=
an><span class=3D"styled-by-prettify" style=3D"color: #000;"><br>=C2=A0 A_v=
iew</span><span class=3D"styled-by-prettify" style=3D"color: #660;">(</span=
><span class=3D"styled-by-prettify" style=3D"color: #008;">const</span><spa=
n class=3D"styled-by-prettify" style=3D"color: #000;"> A </span><span class=
=3D"styled-by-prettify" style=3D"color: #660;">&</span><span class=3D"s=
tyled-by-prettify" style=3D"color: #000;">p</span><span class=3D"styled-by-=
prettify" style=3D"color: #660;">);</span><span class=3D"styled-by-prettify=
" style=3D"color: #000;"><br><br></span><span class=3D"styled-by-prettify" =
style=3D"color: #008;">private</span><span class=3D"styled-by-prettify" sty=
le=3D"color: #660;">:</span><span class=3D"styled-by-prettify" style=3D"col=
or: #000;"><br>=C2=A0 observer_ptr</span><span class=3D"styled-by-prettify"=
style=3D"color: #660;"><</span><span class=3D"styled-by-prettify" style=
=3D"color: #000;">A</span><span class=3D"styled-by-prettify" style=3D"color=
: #660;">></span><span class=3D"styled-by-prettify" style=3D"color: #000=
;"> p_</span><span class=3D"styled-by-prettify" style=3D"color: #660;">;</s=
pan><span class=3D"styled-by-prettify" style=3D"color: #000;"><br></span><s=
pan class=3D"styled-by-prettify" style=3D"color: #660;">};</span></div></co=
de></div><div><br></div><div>How could the compiler<i> possibly</i> know th=
at this code is invalid:</div><div><br></div><div class=3D"prettyprint" sty=
le=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; backgrou=
nd-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"su=
bprettyprint"><span class=3D"styled-by-prettify" style=3D"color: #000;">A_v=
iew v</span><span class=3D"styled-by-prettify" style=3D"color: #660;">(</sp=
an><span class=3D"styled-by-prettify" style=3D"color: #000;">A</span><span =
class=3D"styled-by-prettify" style=3D"color: #660;">{});</span><span class=
=3D"styled-by-prettify" style=3D"color: #000;"><br></span></div></code></di=
v><br><div>We're not talking about runtime detection here; this is pure=
ly compile-time. And the compiler doesn't necessarily see everything. I=
f `A_view` is in another translation unit that isn't visible to static =
analysis, this doesn't work.</div><div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/634a78e7-dc92-4f5e-9105-83339a18b579%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/634a78e7-dc92-4f5e-9105-83339a18b579=
%40isocpp.org</a>.<br />
------=_Part_3059_105007333.1516476681966--
------=_Part_3058_1799439253.1516476681966--
.
Author: mihailnajdenov@gmail.com
Date: Sat, 20 Jan 2018 12:25:13 -0800 (PST)
Raw View
------=_Part_3125_1105812350.1516479913997
Content-Type: multipart/alternative;
boundary="----=_Part_3126_1071090241.1516479913997"
------=_Part_3126_1071090241.1516479913997
Content-Type: text/plain; charset="UTF-8"
On Saturday, January 20, 2018 at 9:31:22 PM UTC+2, Nicol Bolas wrote:
>
> ...
>>
>>
> How would it know? If all the compiler in that translation unit sees is:
>
> class A_view
> {
> public:
> A_view(const A &p);
>
> private:
> observer_ptr<A> p_;
> };
>
> How could the compiler* possibly* know that this code is invalid:
>
> A_view v(A{});
>
> We're not talking about runtime detection here; this is purely
> compile-time. And the compiler doesn't necessarily see everything. If
> `A_view` is in another translation unit that isn't visible to static
> analysis, this doesn't work.
>
You have to be more specific, might be my knowledge failing me, but what
would prevent the compiler seeing in the case when are the dtros of both
variables called?
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/73c5d690-f05d-4e72-a685-3c55d8be0f8e%40isocpp.org.
------=_Part_3126_1071090241.1516479913997
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Saturday, January 20, 2018 at 9:31:22 PM UTC+2,=
Nicol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D=
"ltr">...<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div></di=
v></div></blockquote><div><br></div><div>How would it know? If all the comp=
iler in that translation unit sees is:</div><div><br></div><div style=3D"bo=
rder:1px solid rgb(187,187,187);word-wrap:break-word;background-color:rgb(2=
50,250,250)"><code><div><span style=3D"color:#008">class</span><span style=
=3D"color:#000"> A_view<br></span><span style=3D"color:#660">{</span><span =
style=3D"color:#000"><br></span><span style=3D"color:#008">public</span><sp=
an style=3D"color:#660">:</span><span style=3D"color:#000"><br>=C2=A0 A_vie=
w</span><span style=3D"color:#660">(</span><span style=3D"color:#008">const=
</span><span style=3D"color:#000"> A </span><span style=3D"color:#660">&=
;</span><span style=3D"color:#000">p</span><span style=3D"color:#660">);</s=
pan><span style=3D"color:#000"><br><br></span><span style=3D"color:#008">pr=
ivate</span><span style=3D"color:#660">:</span><span style=3D"color:#000"><=
br>=C2=A0 observer_ptr</span><span style=3D"color:#660"><</span><span st=
yle=3D"color:#000">A</span><span style=3D"color:#660">></span><span styl=
e=3D"color:#000"> p_</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"><br></span><span style=3D"color:#660">};</span></div></code=
></div><div><br></div><div>How could the compiler<i> possibly</i> know that=
this code is invalid:</div><div><br></div><div style=3D"border:1px solid r=
gb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><co=
de><div><span style=3D"color:#000">A_view v</span><span style=3D"color:#660=
">(</span><span style=3D"color:#000">A</span><span style=3D"color:#660">{})=
;</span><span style=3D"color:#000"><br></span></div></code></div><br><div>W=
e're not talking about runtime detection here; this is purely compile-t=
ime. And the compiler doesn't necessarily see everything. If `A_view` i=
s in another translation unit that isn't visible to static analysis, th=
is doesn't work.</div></div></blockquote><div><br></div><div style=3D"t=
ext-align: left;">You have to be more specific, might be my knowledge faili=
ng me, but what would prevent the compiler seeing in the case when are the =
dtros of both variables called? =C2=A0</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/73c5d690-f05d-4e72-a685-3c55d8be0f8e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/73c5d690-f05d-4e72-a685-3c55d8be0f8e=
%40isocpp.org</a>.<br />
------=_Part_3126_1071090241.1516479913997--
------=_Part_3125_1105812350.1516479913997--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sat, 20 Jan 2018 17:45:37 -0800 (PST)
Raw View
------=_Part_564_341905671.1516499137280
Content-Type: multipart/alternative;
boundary="----=_Part_565_1545774573.1516499137280"
------=_Part_565_1545774573.1516499137280
Content-Type: text/plain; charset="UTF-8"
On Saturday, January 20, 2018 at 3:25:14 PM UTC-5, mihailn...@gmail.com
wrote:
>
> On Saturday, January 20, 2018 at 9:31:22 PM UTC+2, Nicol Bolas wrote:
>>
>> ...
>>>
>>>
>> How would it know? If all the compiler in that translation unit sees is:
>>
>> class A_view
>> {
>> public:
>> A_view(const A &p);
>>
>> private:
>> observer_ptr<A> p_;
>> };
>>
>> How could the compiler* possibly* know that this code is invalid:
>>
>> A_view v(A{});
>>
>> We're not talking about runtime detection here; this is purely
>> compile-time. And the compiler doesn't necessarily see everything. If
>> `A_view` is in another translation unit that isn't visible to static
>> analysis, this doesn't work.
>>
>
> You have to be more specific, might be my knowledge failing me, but what
> would prevent the compiler seeing in the case when are the dtros of both
> variables called?
>
In order for the compiler to be able to associate the prvalue temporary
with `A_view`, it must be able to look at the code and see that `A_view`
contains a pointer/reference to that temporary. While the compiler can see
that `A_view`'s constructor is being given a pointer to a temporary, it
does not know what that constructor is doing. It cannot associate the
constructor parameter with `A_view::p_`, because there is no code in this
translation unit that associates the constructor parameter with that member
variable.
Yes, the compiler can see that two destructors are happening. But there is
no evident association between these two objects. And without that
knowledge, the compiler has no right to declare that this code is
problematic.
This is why you need the annotation to be part of the declaration. Because
the declaration may be the only thing the compiler will ever see.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/f8d52182-5aef-476b-b0bb-047843c17e2a%40isocpp.org.
------=_Part_565_1545774573.1516499137280
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Saturday, January 20, 2018 at 3:25:14 PM UTC-5, mihailn=
....@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">On Saturday, January 20, 2018 at 9:31:22 PM UTC+2, Nicol Bolas wro=
te:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">...<blockquote =
class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #=
ccc solid;padding-left:1ex"><div dir=3D"ltr"><div></div></div></blockquote>=
<div><br></div><div>How would it know? If all the compiler in that translat=
ion unit sees is:</div><div><br></div><div style=3D"border:1px solid rgb(18=
7,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><code><d=
iv><span style=3D"color:#008">class</span><span style=3D"color:#000"> A_vie=
w<br></span><span style=3D"color:#660">{</span><span style=3D"color:#000"><=
br></span><span style=3D"color:#008">public</span><span style=3D"color:#660=
">:</span><span style=3D"color:#000"><br>=C2=A0 A_view</span><span style=3D=
"color:#660">(</span><span style=3D"color:#008">const</span><span style=3D"=
color:#000"> A </span><span style=3D"color:#660">&</span><span style=3D=
"color:#000">p</span><span style=3D"color:#660">);</span><span style=3D"col=
or:#000"><br><br></span><span style=3D"color:#008">private</span><span styl=
e=3D"color:#660">:</span><span style=3D"color:#000"><br>=C2=A0 observer_ptr=
</span><span style=3D"color:#660"><</span><span style=3D"color:#000">A</=
span><span style=3D"color:#660">></span><span style=3D"color:#000"> p_</=
span><span style=3D"color:#660">;</span><span style=3D"color:#000"><br></sp=
an><span style=3D"color:#660">};</span></div></code></div><div><br></div><d=
iv>How could the compiler<i> possibly</i> know that this code is invalid:</=
div><div><br></div><div style=3D"border:1px solid rgb(187,187,187);word-wra=
p:break-word;background-color:rgb(250,250,250)"><code><div><span style=3D"c=
olor:#000">A_view v</span><span style=3D"color:#660">(</span><span style=3D=
"color:#000">A</span><span style=3D"color:#660">{});</span><span style=3D"c=
olor:#000"><br></span></div></code></div><br><div>We're not talking abo=
ut runtime detection here; this is purely compile-time. And the compiler do=
esn't necessarily see everything. If `A_view` is in another translation=
unit that isn't visible to static analysis, this doesn't work.</di=
v></div></blockquote><div><br></div><div style=3D"text-align:left">You have=
to be more specific, might be my knowledge failing me, but what would prev=
ent the compiler seeing in the case when are the dtros of both variables ca=
lled?=C2=A0</div></div></blockquote><div><br></div><div>In order for the co=
mpiler to be able to associate the prvalue temporary with `A_view`, it must=
be able to look at the code and see that `A_view` contains a pointer/refer=
ence to that temporary. While the compiler can see that `A_view`'s cons=
tructor is being given a pointer to a temporary, it does not know what that=
constructor is doing. It cannot associate the constructor parameter with `=
A_view::p_`, because there is no code in this translation unit that associa=
tes the constructor parameter with that member variable.</div><div><br></di=
v><div>Yes, the compiler can see that two destructors are happening. But th=
ere is no evident association between these two objects. And without that k=
nowledge, the compiler has no right to declare that this code is problemati=
c.</div><div><br></div><div>This is why you need the annotation to be part =
of the declaration. Because the declaration may be the only thing the compi=
ler will ever see.</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/f8d52182-5aef-476b-b0bb-047843c17e2a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f8d52182-5aef-476b-b0bb-047843c17e2a=
%40isocpp.org</a>.<br />
------=_Part_565_1545774573.1516499137280--
------=_Part_564_341905671.1516499137280--
.
Author: mihailnajdenov@gmail.com
Date: Sun, 21 Jan 2018 05:44:07 -0800 (PST)
Raw View
------=_Part_1851_18905626.1516542247800
Content-Type: multipart/alternative;
boundary="----=_Part_1852_382242868.1516542247801"
------=_Part_1852_382242868.1516542247801
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 21, 2018 at 3:45:37 AM UTC+2, Nicol Bolas wrote:
>
> On Saturday, January 20, 2018 at 3:25:14 PM UTC-5, mihailn...@gmail.com
> wrote:
>>
>> On Saturday, January 20, 2018 at 9:31:22 PM UTC+2, Nicol Bolas wrote:
>>>
>>> ...
>>>>
>>>>
>>> How would it know? If all the compiler in that translation unit sees is:
>>>
>>> class A_view
>>> {
>>> public:
>>> A_view(const A &p);
>>>
>>> private:
>>> observer_ptr<A> p_;
>>> };
>>>
>>> How could the compiler* possibly* know that this code is invalid:
>>>
>>> A_view v(A{});
>>>
>>> We're not talking about runtime detection here; this is purely
>>> compile-time. And the compiler doesn't necessarily see everything. If
>>> `A_view` is in another translation unit that isn't visible to static
>>> analysis, this doesn't work.
>>>
>>
>> You have to be more specific, might be my knowledge failing me, but what
>> would prevent the compiler seeing in the case when are the dtros of both
>> variables called?
>>
>
> In order for the compiler to be able to associate the prvalue temporary
> with `A_view`, it must be able to look at the code and see that `A_view`
> contains a pointer/reference to that temporary. While the compiler can see
> that `A_view`'s constructor is being given a pointer to a temporary, it
> does not know what that constructor is doing. It cannot associate the
> constructor parameter with `A_view::p_`, because there is no code in this
> translation unit that associates the constructor parameter with that member
> variable.
>
> Yes, the compiler can see that two destructors are happening. But there is
> no evident association between these two objects. And without that
> knowledge, the compiler has no right to declare that this code is
> problematic.
>
> This is why you need the annotation to be part of the declaration. Because
> the declaration may be the only thing the compiler will ever see.
>
I see, you mean that only the A_view ctor is visible as a single function
call and nothing beyond that.
If that is the case, then both view (its ctor) and observer_ptr must be
inlined. Luckily, that covers practically all views and observer_ptr is a
template already.
Surely it would be a noticeable limitation, but will not make the feature
useless.
However, that does not have to be the case. I was assuming some sort of
"entire program" analysis.
In that case the analyzer sees observer_ptr as part of the A_view
declaration in the header, then it sees the decorated constructor of observer_ptr,
after that it goes and "recompiles" the A_view object file to see how the
association is made.
As I said, I was assuming "entire program" analysis, because otherwise
*copies* of views would be impossible to implement.
Not just copies, but code like this
void f(observer_ptr<P> pv)
{
kill_p_by_accident(); //< some function using p, not in the TU
// warn of using pv after potential kill
}
The quotes in "entire program" are important. The whole point of
decorations is to have *targeted *analysis - real "entire program" analysis are
too slow and too noisy.
If the analyzer have all the source, to all the translation units, *and*
knows what to look for, then it *should* be able to do reasonably fast and
reasonably accurate predictions.
I am not insisting of "entire program", though, just speculating what would
be possible and useful!
I would be happy with *anything, *any scaled back version of this (or
something similar), because now, out of the box, we have *nothing**.*
And what we have, the external tools, have to do a ton of guess work simply
because C++ deliberately ignores their existence.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7ce99930-b0b8-41cc-b3ea-7501e265bb62%40isocpp.org.
------=_Part_1852_382242868.1516542247801
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, January 21, 2018 at 3:45:37 AM UTC+2, N=
icol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr">On Saturday, January 20, 2018 at 3:25:14 PM UTC-5, <a>mihailn...@gmail.=
com</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-le=
ft:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On S=
aturday, January 20, 2018 at 9:31:22 PM UTC+2, Nicol Bolas wrote:<blockquot=
e class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px=
#ccc solid;padding-left:1ex"><div dir=3D"ltr">...<blockquote class=3D"gmai=
l_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;pad=
ding-left:1ex"><div dir=3D"ltr"><div></div></div></blockquote><div><br></di=
v><div>How would it know? If all the compiler in that translation unit sees=
is:</div><div><br></div><div style=3D"border:1px solid rgb(187,187,187);wo=
rd-wrap:break-word;background-color:rgb(250,250,250)"><code><div><span styl=
e=3D"color:#008">class</span><span style=3D"color:#000"> A_view<br></span><=
span style=3D"color:#660">{</span><span style=3D"color:#000"><br></span><sp=
an style=3D"color:#008">public</span><span style=3D"color:#660">:</span><sp=
an style=3D"color:#000"><br>=C2=A0 A_view</span><span style=3D"color:#660">=
(</span><span style=3D"color:#008">const</span><span style=3D"color:#000"> =
A </span><span style=3D"color:#660">&</span><span style=3D"color:#000">=
p</span><span style=3D"color:#660">);</span><span style=3D"color:#000"><br>=
<br></span><span style=3D"color:#008">private</span><span style=3D"color:#6=
60">:</span><span style=3D"color:#000"><br>=C2=A0 observer_ptr</span><span =
style=3D"color:#660"><</span><span style=3D"color:#000">A</span><span st=
yle=3D"color:#660">></span><span style=3D"color:#000"> p_</span><span st=
yle=3D"color:#660">;</span><span style=3D"color:#000"><br></span><span styl=
e=3D"color:#660">};</span></div></code></div><div><br></div><div>How could =
the compiler<i> possibly</i> know that this code is invalid:</div><div><br>=
</div><div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;=
background-color:rgb(250,250,250)"><code><div><span style=3D"color:#000">A_=
view v</span><span style=3D"color:#660">(</span><span style=3D"color:#000">=
A</span><span style=3D"color:#660">{});</span><span style=3D"color:#000"><b=
r></span></div></code></div><br><div>We're not talking about runtime de=
tection here; this is purely compile-time. And the compiler doesn't nec=
essarily see everything. If `A_view` is in another translation unit that is=
n't visible to static analysis, this doesn't work.</div></div></blo=
ckquote><div><br></div><div style=3D"text-align:left">You have to be more s=
pecific, might be my knowledge failing me, but what would prevent the compi=
ler seeing in the case when are the dtros of both variables called?=C2=A0</=
div></div></blockquote><div><br></div><div>In order for the compiler to be =
able to associate the prvalue temporary with `A_view`, it must be able to l=
ook at the code and see that `A_view` contains a pointer/reference to that =
temporary. While the compiler can see that `A_view`'s constructor is be=
ing given a pointer to a temporary, it does not know what that constructor =
is doing. It cannot associate the constructor parameter with `A_view::p_`, =
because there is no code in this translation unit that associates the const=
ructor parameter with that member variable.</div><div><br></div><div>Yes, t=
he compiler can see that two destructors are happening. But there is no evi=
dent association between these two objects. And without that knowledge, the=
compiler has no right to declare that this code is problematic.</div><div>=
<br></div><div>This is why you need the annotation to be part of the declar=
ation. Because the declaration may be the only thing the compiler will ever=
see.</div></div></blockquote><div><br></div><div><br></div><div>I see, you=
mean that only the A_view ctor is visible as a single function call and no=
thing beyond that.</div><div><br></div><div>If that is the case, then both =
view (its ctor) and observer_ptr must be inlined. Luckily, that covers prac=
tically all views and observer_ptr is a template already. </div><div>Surely=
it would be a noticeable limitation, but will not make the feature useless=
..=C2=A0</div><div><br></div><div><br></div><div><br></div><div>However, tha=
t does not have to be the case. I was assuming some sort of "entire pr=
ogram" analysis.</div><div><font face=3D"courier new"><br></font></div=
><div>In that case the analyzer sees observer_ptr as part of the A_view dec=
laration in the header, then it sees the decorated constructor of <span sty=
le=3D"display: inline !important; float: none; background-color: transparen=
t; color: rgb(34, 34, 34); font-family: "Arial","Helvetica&q=
uot;,sans-serif; font-size: 13px; font-style: normal; font-variant: normal;=
font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; te=
xt-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-s=
troke-width: 0px; white-space: normal; word-spacing: 0px;">observer_ptr, </=
span></div><div><span style=3D"display: inline !important; float: none; bac=
kground-color: transparent; color: rgb(34, 34, 34); font-family: "Aria=
l","Helvetica",sans-serif; font-size: 13px; font-style: norm=
al; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans=
: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transf=
orm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacin=
g: 0px;">after that it goes and "recompiles" the A_view object fi=
le to see how the association is made.</span></div><div><b><br></b></div><d=
iv><span style=3D"display: inline !important; float: none; background-color=
: transparent; color: rgb(34, 34, 34); font-family: "Arial","=
;Helvetica",sans-serif; font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-ali=
gn: left; text-decoration: none; text-indent: 0px; text-transform: none; -w=
ebkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">As I=
said, I was assuming "entire program" analysis, because otherwis=
e</span><font face=3D"arial,sans-serif"> <i>copies</i> of views would be im=
possible to implement.</font></div><div><div style=3D"background-color: tra=
nsparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; =
border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stre=
tch; border-image-slice: 100%; border-image-source: none; border-image-widt=
h: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-l=
eft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: no=
ne; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-=
style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &a=
mp;quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size=
: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-=
spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; m=
argin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding=
-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; tex=
t-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-=
space: normal; word-spacing: 0px;"><br></div><div style=3D"background-color=
: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: n=
one; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat:=
stretch; border-image-slice: 100%; border-image-source: none; border-image=
-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; bor=
der-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-styl=
e: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border=
-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-famil=
y: &quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font=
-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; le=
tter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0=
px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; pa=
dding-right: 0px; padding-top: 0px; text-align: left; text-decoration: none=
; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; w=
hite-space: normal; word-spacing: 0px;">Not just copies, but code like this=
</div><div style=3D"background-color: transparent; border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;=
Helvetica&quot;,sans-serif; font-size: 13px; font-style: normal; font-v=
ariant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0p=
x; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; paddin=
g-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; tex=
t-align: left; text-decoration: none; text-indent: 0px; text-transform: non=
e; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"=
><br></div><div style=3D"margin: 0px; padding: 0px; border: 0px rgb(34, 34,=
34); border-image: none; text-align: left; color: rgb(34, 34, 34); text-tr=
ansform: none; text-indent: 0px; letter-spacing: normal; font-size: 13px; f=
ont-variant: normal; word-spacing: 0px; white-space: normal; orphans: 2; -w=
ebkit-text-stroke-width: 0px; background-color: transparent;"><div style=3D=
"background-color: transparent; border-bottom-color: rgb(34, 34, 34); borde=
r-bottom-style: none; border-bottom-width: 0px; border-image-outset: 0; bor=
der-image-repeat: stretch; border-image-slice: 100%; border-image-source: n=
one; border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left=
-style: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); =
border-right-style: none; border-right-width: 0px; border-top-color: rgb(34=
, 34, 34); border-top-style: none; border-top-width: 0px; color: rgb(34, 34=
, 34); font-family: &quot;Arial&quot;,&quot;Helvetica&quot;=
,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; fon=
t-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px=
; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 0px; padd=
ing-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text=
-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-str=
oke-width: 0px; white-space: normal; word-spacing: 0px;"><font face=3D"cour=
ier new,monospace" style=3D"border-bottom-color: rgb(34, 34, 34); border-bo=
ttom-style: none; border-bottom-width: 0px; border-image-outset: 0; border-=
image-repeat: stretch; border-image-slice: 100%; border-image-source: none;=
border-image-width: 1; border-left-color: rgb(34, 34, 34); border-left-sty=
le: none; border-left-width: 0px; border-right-color: rgb(34, 34, 34); bord=
er-right-style: none; border-right-width: 0px; border-top-color: rgb(34, 34=
, 34); border-top-style: none; border-top-width: 0px; margin-bottom: 0px; m=
argin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; p=
adding-left: 0px; padding-right: 0px; padding-top: 0px;">void f(observer_pt=
r<P> pv)</font></div><div style=3D"background-color: transparent; bor=
der-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom=
-width: 0px; border-image-outset: 0; border-image-repeat: stretch; border-i=
mage-slice: 100%; border-image-source: none; border-image-width: 1; border-=
left-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0p=
x; border-right-color: rgb(34, 34, 34); border-right-style: none; border-ri=
ght-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; =
border-top-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial=
&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-=
style: normal; font-variant: normal; font-weight: 400; letter-spacing: norm=
al; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0p=
x; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; =
padding-top: 0px; text-align: left; text-decoration: none; text-indent: 0px=
; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal=
; word-spacing: 0px;"><font face=3D"courier new,monospace" style=3D"border-=
bottom-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-wid=
th: 0px; border-image-outset: 0; border-image-repeat: stretch; border-image=
-slice: 100%; border-image-source: none; border-image-width: 1; border-left=
-color: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; b=
order-right-color: rgb(34, 34, 34); border-right-style: none; border-right-=
width: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; bord=
er-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;=
margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0p=
x; padding-top: 0px;">{</font></div><div style=3D"background-color: transpa=
rent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; bord=
er-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch;=
border-image-slice: 100%; border-image-source: none; border-image-width: 1=
; border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-=
width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; =
border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-styl=
e: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family: &q=
uot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-size: 13=
px; font-style: normal; font-variant: normal; font-weight: 400; letter-spac=
ing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margi=
n-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-rig=
ht: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-in=
dent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-spac=
e: normal; word-spacing: 0px;"><font face=3D"courier new,monospace" style=
=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; border=
-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stretch; b=
order-image-slice: 100%; border-image-source: none; border-image-width: 1; =
border-left-color: rgb(34, 34, 34); border-left-style: none; border-left-wi=
dth: 0px; border-right-color: rgb(34, 34, 34); border-right-style: none; bo=
rder-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-style:=
none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-=
right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; paddin=
g-right: 0px; padding-top: 0px;">=C2=A0 kill_p_by_accident(); //< some f=
unction using p, not in the TU</font></div><div style=3D"background-color: =
transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style: non=
e; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: s=
tretch; border-image-slice: 100%; border-image-source: none; border-image-w=
idth: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; borde=
r-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style:=
none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-t=
op-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-family:=
&quot;Arial&quot;,&quot;Helvetica&quot;,sans-serif; font-s=
ize: 13px; font-style: normal; font-variant: normal; font-weight: 400; lett=
er-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px=
; margin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padd=
ing-right: 0px; padding-top: 0px; text-align: left; text-decoration: none; =
text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whi=
te-space: normal; word-spacing: 0px;"><font face=3D"courier new,monospace" =
style=3D"border-bottom-color: rgb(34, 34, 34); border-bottom-style: none; b=
order-bottom-width: 0px; border-image-outset: 0; border-image-repeat: stret=
ch; border-image-slice: 100%; border-image-source: none; border-image-width=
: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; border-le=
ft-width: 0px; border-right-color: rgb(34, 34, 34); border-right-style: non=
e; border-right-width: 0px; border-top-color: rgb(34, 34, 34); border-top-s=
tyle: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; ma=
rgin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; p=
adding-right: 0px; padding-top: 0px;"><br style=3D"border-bottom-color: rgb=
(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border-i=
mage-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; bor=
der-image-source: none; border-image-width: 1; border-left-color: rgb(34, 3=
4, 34); border-left-style: none; border-left-width: 0px; border-right-color=
: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; borde=
r-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px=
; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;=
padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0=
px;"></font></div><div style=3D"background-color: transparent; border-botto=
m-color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0=
px; border-image-outset: 0; border-image-repeat: stretch; border-image-slic=
e: 100%; border-image-source: none; border-image-width: 1; border-left-colo=
r: rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border=
-right-color: rgb(34, 34, 34); border-right-style: none; border-right-width=
: 0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-to=
p-width: 0px; color: rgb(34, 34, 34); font-family: &quot;Arial&quot=
;,&quot;Helvetica&quot;,sans-serif; font-size: 13px; font-style: no=
rmal; font-variant: normal; font-weight: 400; letter-spacing: normal; margi=
n-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphan=
s: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-t=
op: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-tr=
ansform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-sp=
acing: 0px;"><font face=3D"courier new,monospace" style=3D"border-bottom-co=
lor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; =
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 1=
00%; border-image-source: none; border-image-width: 1; border-left-color: r=
gb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-rig=
ht-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0p=
x; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wi=
dth: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-t=
op: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; paddin=
g-top: 0px;">=C2=A0// warn of using pv after potential kill</font></div><di=
v style=3D"background-color: transparent; border-bottom-color: rgb(34, 34, =
34); border-bottom-style: none; border-bottom-width: 0px; border-image-outs=
et: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image=
-source: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); b=
order-left-style: none; border-left-width: 0px; border-right-color: rgb(34,=
34, 34); border-right-style: none; border-right-width: 0px; border-top-col=
or: rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; color: =
rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Helvetica=
&quot;,sans-serif; font-size: 13px; font-style: normal; font-variant: n=
ormal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin=
-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom:=
0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: =
left; text-decoration: none; text-indent: 0px; text-transform: none; -webki=
t-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><font fa=
ce=3D"courier new,monospace" style=3D"border-bottom-color: rgb(34, 34, 34);=
border-bottom-style: none; border-bottom-width: 0px; border-image-outset: =
0; border-image-repeat: stretch; border-image-slice: 100%; border-image-sou=
rce: none; border-image-width: 1; border-left-color: rgb(34, 34, 34); borde=
r-left-style: none; border-left-width: 0px; border-right-color: rgb(34, 34,=
34); border-right-style: none; border-right-width: 0px; border-top-color: =
rgb(34, 34, 34); border-top-style: none; border-top-width: 0px; margin-bott=
om: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bott=
om: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}</font>=
</div><b></b></div></div><div><font face=3D"arial,sans-serif"><b><i><br></i=
></b></font></div><div><b><i><br></i></b></div><div>The quotes in "ent=
ire program" are important. The whole point of decorations is to have =
<i>targeted </i>analysis - real "entire program" <span style=3D"d=
isplay: inline !important; float: none; background-color: transparent; colo=
r: rgb(34, 34, 34); font-family: "Arial","Helvetica",sa=
ns-serif; font-size: 13px; font-style: normal; font-variant: normal; font-w=
eight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-deco=
ration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-w=
idth: 0px; white-space: normal; word-spacing: 0px;">analysis</span><span st=
yle=3D"display: inline !important; float: none; background-color: transpare=
nt; color: rgb(34, 34, 34); font-family: "Arial","Helvetica&=
quot;,sans-serif; font-size: 13px; font-style: normal; font-variant: normal=
; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; t=
ext-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-=
stroke-width: 0px; white-space: normal; word-spacing: 0px;"> </span>are too=
slow and too noisy.</div><div><br></div><div>If the analyzer have all the =
source, to all the translation units, <i>and</i> knows what to look for, th=
en it <i>should</i> be able to do reasonably fast and reasonably accurate p=
redictions.</div><div><br></div><div><br></div><div><br></div><div>I am not=
insisting of "entire program", though, just speculating what wou=
ld be possible and useful!</div><div><br></div><div> I would be happy with =
<i>anything, </i>any scaled back version of this (or something similar), be=
cause now, <span style=3D"display: inline !important; float: none; backgrou=
nd-color: transparent; color: rgb(34, 34, 34); font-family: "Arial&quo=
t;,"Helvetica",sans-serif; font-size: 13px; font-style: normal; f=
ont-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; =
text-align: left; text-decoration: none; text-indent: 0px; text-transform: =
none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0p=
x;">out of the box, </span>we have <i>nothing</i><i>.</i></div><div>And wha=
t we have, the external tools, have to do a ton of guess work simply becaus=
e C++ deliberately ignores their existence.</div><div><i><br></i></div><div=
>=C2=A0</div><div>=C2=A0</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7ce99930-b0b8-41cc-b3ea-7501e265bb62%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7ce99930-b0b8-41cc-b3ea-7501e265bb62=
%40isocpp.org</a>.<br />
------=_Part_1852_382242868.1516542247801--
------=_Part_1851_18905626.1516542247800--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sun, 21 Jan 2018 07:03:50 -0800 (PST)
Raw View
------=_Part_1984_1120087284.1516547030674
Content-Type: multipart/alternative;
boundary="----=_Part_1985_1183044891.1516547030674"
------=_Part_1985_1183044891.1516547030674
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 21, 2018 at 8:44:07 AM UTC-5, mihailn...@gmail.com wrote:
>
> On Sunday, January 21, 2018 at 3:45:37 AM UTC+2, Nicol Bolas wrote:
>>
>> On Saturday, January 20, 2018 at 3:25:14 PM UTC-5, mihailn...@gmail.com
>> wrote:
>>>
>>> On Saturday, January 20, 2018 at 9:31:22 PM UTC+2, Nicol Bolas wrote:
>>>>
>>>> ...
>>>>>
>>>>>
>>>> How would it know? If all the compiler in that translation unit sees is:
>>>>
>>>> class A_view
>>>> {
>>>> public:
>>>> A_view(const A &p);
>>>>
>>>> private:
>>>> observer_ptr<A> p_;
>>>> };
>>>>
>>>> How could the compiler* possibly* know that this code is invalid:
>>>>
>>>> A_view v(A{});
>>>>
>>>> We're not talking about runtime detection here; this is purely
>>>> compile-time. And the compiler doesn't necessarily see everything. If
>>>> `A_view` is in another translation unit that isn't visible to static
>>>> analysis, this doesn't work.
>>>>
>>>
>>> You have to be more specific, might be my knowledge failing me, but what
>>> would prevent the compiler seeing in the case when are the dtros of both
>>> variables called?
>>>
>>
>> In order for the compiler to be able to associate the prvalue temporary
>> with `A_view`, it must be able to look at the code and see that `A_view`
>> contains a pointer/reference to that temporary. While the compiler can see
>> that `A_view`'s constructor is being given a pointer to a temporary, it
>> does not know what that constructor is doing. It cannot associate the
>> constructor parameter with `A_view::p_`, because there is no code in this
>> translation unit that associates the constructor parameter with that member
>> variable.
>>
>> Yes, the compiler can see that two destructors are happening. But there
>> is no evident association between these two objects. And without that
>> knowledge, the compiler has no right to declare that this code is
>> problematic.
>>
>> This is why you need the annotation to be part of the declaration.
>> Because the declaration may be the only thing the compiler will ever see.
>>
>
>
> I see, you mean that only the A_view ctor is visible as a single function
> call and nothing beyond that.
>
> If that is the case, then both view (its ctor) and observer_ptr must be
> inlined. Luckily, that covers practically all views and observer_ptr is a
> template already.
> Surely it would be a noticeable limitation, but will not make the feature
> useless.
>
But that wishy-washy-ness is exactly what makes this not a feature* of the
standard*. It's a compiler tool or a static analysis tool, not something
the standard can deal with.
And quite frankly, if you have a static analysis tool that can do
whole-program analysis, I'd bet that it could be smart enough to figure out
that `observer_ptr` is not destroying the pointer it's given just by
analyzing its member functions. So you don't even need that attribute to
tell such a tool what's going on; just let it figure out which types are
"observer" types.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/f84c0f99-1ce6-493b-b7fc-3a643648c607%40isocpp.org.
------=_Part_1985_1183044891.1516547030674
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Sunday, January 21, 2018 at 8:44:07 AM UTC-5, mihailn..=
..@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr">On Sunday, January 21, 2018 at 3:45:37 AM UTC+2, Nicol Bolas wrote:<bl=
ockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Saturday, January =
20, 2018 at 3:25:14 PM UTC-5, <a>mihailn...@gmail.com</a> wrote:<blockquote=
class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div dir=3D"ltr">On Saturday, January 20, 2018=
at 9:31:22 PM UTC+2, Nicol Bolas wrote:<blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr">...<blockquote class=3D"gmail_quote" style=3D"margin:=
0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div></div></div></blockquote><div><br></div><div>How would it kno=
w? If all the compiler in that translation unit sees is:</div><div><br></di=
v><div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;back=
ground-color:rgb(250,250,250)"><code><div><span style=3D"color:#008">class<=
/span><span style=3D"color:#000"> A_view<br></span><span style=3D"color:#66=
0">{</span><span style=3D"color:#000"><br></span><span style=3D"color:#008"=
>public</span><span style=3D"color:#660">:</span><span style=3D"color:#000"=
><br>=C2=A0 A_view</span><span style=3D"color:#660">(</span><span style=3D"=
color:#008">const</span><span style=3D"color:#000"> A </span><span style=3D=
"color:#660">&</span><span style=3D"color:#000">p</span><span style=3D"=
color:#660">);</span><span style=3D"color:#000"><br><br></span><span style=
=3D"color:#008">private</span><span style=3D"color:#660">:</span><span styl=
e=3D"color:#000"><br>=C2=A0 observer_ptr</span><span style=3D"color:#660">&=
lt;</span><span style=3D"color:#000">A</span><span style=3D"color:#660">>=
;</span><span style=3D"color:#000"> p_</span><span style=3D"color:#660">;</=
span><span style=3D"color:#000"><br></span><span style=3D"color:#660">};</s=
pan></div></code></div><div><br></div><div>How could the compiler<i> possib=
ly</i> know that this code is invalid:</div><div><br></div><div style=3D"bo=
rder:1px solid rgb(187,187,187);word-wrap:break-word;background-color:rgb(2=
50,250,250)"><code><div><span style=3D"color:#000">A_view v</span><span sty=
le=3D"color:#660">(</span><span style=3D"color:#000">A</span><span style=3D=
"color:#660">{});</span><span style=3D"color:#000"><br></span></div></code>=
</div><br><div>We're not talking about runtime detection here; this is =
purely compile-time. And the compiler doesn't necessarily see everythin=
g. If `A_view` is in another translation unit that isn't visible to sta=
tic analysis, this doesn't work.</div></div></blockquote><div><br></div=
><div style=3D"text-align:left">You have to be more specific, might be my k=
nowledge failing me, but what would prevent the compiler seeing in the case=
when are the dtros of both variables called?=C2=A0</div></div></blockquote=
><div><br></div><div>In order for the compiler to be able to associate the =
prvalue temporary with `A_view`, it must be able to look at the code and se=
e that `A_view` contains a pointer/reference to that temporary. While the c=
ompiler can see that `A_view`'s constructor is being given a pointer to=
a temporary, it does not know what that constructor is doing. It cannot as=
sociate the constructor parameter with `A_view::p_`, because there is no co=
de in this translation unit that associates the constructor parameter with =
that member variable.</div><div><br></div><div>Yes, the compiler can see th=
at two destructors are happening. But there is no evident association betwe=
en these two objects. And without that knowledge, the compiler has no right=
to declare that this code is problematic.</div><div><br></div><div>This is=
why you need the annotation to be part of the declaration. Because the dec=
laration may be the only thing the compiler will ever see.</div></div></blo=
ckquote><div><br></div><div><br></div><div>I see, you mean that only the A_=
view ctor is visible as a single function call and nothing beyond that.</di=
v><div><br></div><div>If that is the case, then both view (its ctor) and ob=
server_ptr must be inlined. Luckily, that covers practically all views and =
observer_ptr is a template already. </div><div>Surely it would be a noticea=
ble limitation, but will not make the feature useless.=C2=A0</div></div></b=
lockquote><div><br></div><div>But that wishy-washy-ness is exactly what mak=
es this not a feature<i> of the standard</i>. It's a compiler tool or a=
static analysis tool, not something the standard can deal with.</div><div>=
<br></div><div>And quite frankly, if you have a static analysis tool that c=
an do whole-program analysis, I'd bet that it could be smart enough to =
figure out that `observer_ptr` is not destroying the pointer it's given=
just by analyzing its member functions. So you don't even need that at=
tribute to tell such a tool what's going on; just let it figure out whi=
ch types are "observer" types.</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/f84c0f99-1ce6-493b-b7fc-3a643648c607%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f84c0f99-1ce6-493b-b7fc-3a643648c607=
%40isocpp.org</a>.<br />
------=_Part_1985_1183044891.1516547030674--
------=_Part_1984_1120087284.1516547030674--
.
Author: mihailnajdenov@gmail.com
Date: Sun, 21 Jan 2018 08:57:06 -0800 (PST)
Raw View
------=_Part_2316_64331752.1516553826253
Content-Type: multipart/alternative;
boundary="----=_Part_2317_35507188.1516553826254"
------=_Part_2317_35507188.1516553826254
Content-Type: text/plain; charset="UTF-8"
On Sunday, January 21, 2018 at 5:03:50 PM UTC+2, Nicol Bolas wrote:
>
> On Sunday, January 21, 2018 at 8:44:07 AM UTC-5, mihailn...@gmail.com
> wrote:
>>
>> On Sunday, January 21, 2018 at 3:45:37 AM UTC+2, Nicol Bolas wrote:
>>>
>>> On Saturday, January 20, 2018 at 3:25:14 PM UTC-5, mihailn...@gmail.com
>>> wrote:
>>>>
>>>> On Saturday, January 20, 2018 at 9:31:22 PM UTC+2, Nicol Bolas wrote:
>>>>>
>>>>> ...
>>>>>>
>>>>>>
>>>>> How would it know? If all the compiler in that translation unit sees
>>>>> is:
>>>>>
>>>>> class A_view
>>>>> {
>>>>> public:
>>>>> A_view(const A &p);
>>>>>
>>>>> private:
>>>>> observer_ptr<A> p_;
>>>>> };
>>>>>
>>>>> How could the compiler* possibly* know that this code is invalid:
>>>>>
>>>>> A_view v(A{});
>>>>>
>>>>> We're not talking about runtime detection here; this is purely
>>>>> compile-time. And the compiler doesn't necessarily see everything. If
>>>>> `A_view` is in another translation unit that isn't visible to static
>>>>> analysis, this doesn't work.
>>>>>
>>>>
>>>> You have to be more specific, might be my knowledge failing me, but
>>>> what would prevent the compiler seeing in the case when are the dtros of
>>>> both variables called?
>>>>
>>>
>>> In order for the compiler to be able to associate the prvalue temporary
>>> with `A_view`, it must be able to look at the code and see that `A_view`
>>> contains a pointer/reference to that temporary. While the compiler can see
>>> that `A_view`'s constructor is being given a pointer to a temporary, it
>>> does not know what that constructor is doing. It cannot associate the
>>> constructor parameter with `A_view::p_`, because there is no code in this
>>> translation unit that associates the constructor parameter with that member
>>> variable.
>>>
>>> Yes, the compiler can see that two destructors are happening. But there
>>> is no evident association between these two objects. And without that
>>> knowledge, the compiler has no right to declare that this code is
>>> problematic.
>>>
>>> This is why you need the annotation to be part of the declaration.
>>> Because the declaration may be the only thing the compiler will ever see.
>>>
>>
>>
>> I see, you mean that only the A_view ctor is visible as a single function
>> call and nothing beyond that.
>>
>> If that is the case, then both view (its ctor) and observer_ptr must be
>> inlined. Luckily, that covers practically all views and observer_ptr is a
>> template already.
>> Surely it would be a noticeable limitation, but will not make the feature
>> useless.
>>
>
> But that wishy-washy-ness is exactly what makes this not a feature* of
> the standard*. It's a compiler tool or a static analysis tool, not
> something the standard can deal with.
>
> And quite frankly, if you have a static analysis tool that can do
> whole-program analysis, I'd bet that it could be smart enough to figure out
> that `observer_ptr` is not destroying the pointer it's given just by
> analyzing its member functions. So you don't even need that attribute to
> tell such a tool what's going on; just let it figure out which types are
> "observer" types.
>
Without decoration it will not know to look in that TU. Actually the other
way around - TU will be ignored unless a type it exports (or uses) is
decorated. Even if all units use an observer pointer, not all pointers or
objects will be an observer or decorated.
Looking for specific pointers should be faster then looking for all
pointers, among a bunch of other things as well.
About wishy-washy-ness.
The implementers will say what it is feasible, much like it is today with
other features. They can also say what is required to improve their work -
what sort of decorations, where.
Considering C++ already defined an interface to communicate with the
implementations - the attributes - I don't see a reason not to use that
interface to improve *both *the implementation and the language (as
experience, not semantics).
But, OK, fine, do not define these in "The C++ standard", define them as
part of "C++ Guidelines" - it is, after all, for the correct use of the
language.
The point is, ignoring and/or not helping the tools is a game where
*everybody* loses.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/8033786d-9929-47fa-9ddb-d12a47408660%40isocpp.org.
------=_Part_2317_35507188.1516553826254
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, January 21, 2018 at 5:03:50 PM UTC+2, N=
icol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr">On Sunday, January 21, 2018 at 8:44:07 AM UTC-5, <a>mihailn...@gmail.co=
m</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left=
:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Sun=
day, January 21, 2018 at 3:45:37 AM UTC+2, Nicol Bolas wrote:<blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #cc=
c solid;padding-left:1ex"><div dir=3D"ltr">On Saturday, January 20, 2018 at=
3:25:14 PM UTC-5, <a>mihailn...@gmail.com</a> wrote:<blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr">On Saturday, January 20, 2018 at 9:31:22=
PM UTC+2, Nicol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"mar=
gin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div d=
ir=3D"ltr">...<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-le=
ft:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div=
></div></div></blockquote><div><br></div><div>How would it know? If all the=
compiler in that translation unit sees is:</div><div><br></div><div style=
=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;background-color=
:rgb(250,250,250)"><code><div><span style=3D"color:#008">class</span><span =
style=3D"color:#000"> A_view<br></span><span style=3D"color:#660">{</span><=
span style=3D"color:#000"><br></span><span style=3D"color:#008">public</spa=
n><span style=3D"color:#660">:</span><span style=3D"color:#000"><br>=C2=A0 =
A_view</span><span style=3D"color:#660">(</span><span style=3D"color:#008">=
const</span><span style=3D"color:#000"> A </span><span style=3D"color:#660"=
>&</span><span style=3D"color:#000">p</span><span style=3D"color:#660">=
);</span><span style=3D"color:#000"><br><br></span><span style=3D"color:#00=
8">private</span><span style=3D"color:#660">:</span><span style=3D"color:#0=
00"><br>=C2=A0 observer_ptr</span><span style=3D"color:#660"><</span><sp=
an style=3D"color:#000">A</span><span style=3D"color:#660">></span><span=
style=3D"color:#000"> p_</span><span style=3D"color:#660">;</span><span st=
yle=3D"color:#000"><br></span><span style=3D"color:#660">};</span></div></c=
ode></div><div><br></div><div>How could the compiler<i> possibly</i> know t=
hat this code is invalid:</div><div><br></div><div style=3D"border:1px soli=
d rgb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)">=
<code><div><span style=3D"color:#000">A_view v</span><span style=3D"color:#=
660">(</span><span style=3D"color:#000">A</span><span style=3D"color:#660">=
{});</span><span style=3D"color:#000"><br></span></div></code></div><br><di=
v>We're not talking about runtime detection here; this is purely compil=
e-time. And the compiler doesn't necessarily see everything. If `A_view=
` is in another translation unit that isn't visible to static analysis,=
this doesn't work.</div></div></blockquote><div><br></div><div style=
=3D"text-align:left">You have to be more specific, might be my knowledge fa=
iling me, but what would prevent the compiler seeing in the case when are t=
he dtros of both variables called?=C2=A0</div></div></blockquote><div><br><=
/div><div>In order for the compiler to be able to associate the prvalue tem=
porary with `A_view`, it must be able to look at the code and see that `A_v=
iew` contains a pointer/reference to that temporary. While the compiler can=
see that `A_view`'s constructor is being given a pointer to a temporar=
y, it does not know what that constructor is doing. It cannot associate the=
constructor parameter with `A_view::p_`, because there is no code in this =
translation unit that associates the constructor parameter with that member=
variable.</div><div><br></div><div>Yes, the compiler can see that two dest=
ructors are happening. But there is no evident association between these tw=
o objects. And without that knowledge, the compiler has no right to declare=
that this code is problematic.</div><div><br></div><div>This is why you ne=
ed the annotation to be part of the declaration. Because the declaration ma=
y be the only thing the compiler will ever see.</div></div></blockquote><di=
v><br></div><div><br></div><div>I see, you mean that only the A_view ctor i=
s visible as a single function call and nothing beyond that.</div><div><br>=
</div><div>If that is the case, then both view (its ctor) and observer_ptr =
must be inlined. Luckily, that covers practically all views and observer_pt=
r is a template already. </div><div>Surely it would be a noticeable limitat=
ion, but will not make the feature useless.=C2=A0</div></div></blockquote><=
div><br></div><div>But that wishy-washy-ness is exactly what makes this not=
a feature<i> of the standard</i>. It's a compiler tool or a static ana=
lysis tool, not something the standard can deal with.</div><div><br></div><=
div>And quite frankly, if you have a static analysis tool that can do whole=
-program analysis, I'd bet that it could be smart enough to figure out =
that `observer_ptr` is not destroying the pointer it's given just by an=
alyzing its member functions. So you don't even need that attribute to =
tell such a tool what's going on; just let it figure out which types ar=
e "observer" types.</div></div></blockquote><div><br></div><div><=
br></div><div><br></div><div>Without decoration it will not know to look in=
that TU. Actually the other way around - TU will be ignored unless a type =
it exports (or uses) is decorated. Even if all units use an observer pointe=
r, not all pointers or objects will be an <span style=3D"display: inline !i=
mportant; float: none; background-color: transparent; color: rgb(34, 34, 34=
); font-family: "Arial","Helvetica",sans-serif; font-si=
ze: 13px; font-style: normal; font-variant: normal; font-weight: 400; lette=
r-spacing: normal; orphans: 2; text-align: left; text-decoration: none; tex=
t-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-=
space: normal; word-spacing: 0px;">observer or decorated</span>.</div><div>=
Looking for specific pointers should be faster then looking for all pointer=
s, among a bunch of other things as well.=C2=A0</div><div><br></div><div><b=
r></div><div>About wishy-washy-ness. </div><div>The implementers will say w=
hat it is feasible, much like it is today with other features. They can als=
o say what is required to improve their work - what sort of decorations, wh=
ere.=C2=A0</div><div>Considering C++ already defined an interface to commun=
icate with the implementations - the attributes - I don't see a reason =
not to use that interface to improve <i>both </i>the implementation and the=
language (as experience, not semantics).</div><div><br></div><div>But, OK,=
fine, do not define these in "The C++ standard", define them as =
part of "C++ Guidelines" - it is, after all, for the<i> </i>corre=
ct use of the language.</div><div> <br></div><div>The point is, ignoring an=
d/or not helping the tools is a game where <i>everybody</i> loses.</div><di=
v><br></div><div>=C2=A0</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/8033786d-9929-47fa-9ddb-d12a47408660%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8033786d-9929-47fa-9ddb-d12a47408660=
%40isocpp.org</a>.<br />
------=_Part_2317_35507188.1516553826254--
------=_Part_2316_64331752.1516553826253--
.