Topic: Object scope access
Author: Ezekiel Warren <zekewarren@gmail.com>
Date: Thu, 24 Jul 2014 14:43:22 -0700 (PDT)
Raw View
------=_Part_761_141696358.1406238202054
Content-Type: text/plain; charset=UTF-8
I propose having the ability to create a scope with access to an objects
members.
*This example explains itself:*
struct Person {
string name;
int age;
};
Person person;
// Creating a new scope with access to an objects members
person.{
if(name == "gord") {
age = 99;
}
}
// Function with access to an objects members
void Func() person.{
age += 2;
}
// Lambda with access to an objects members
auto Lambda = [] person.{
age -= 2;
};
It would also work with if, else, for, while, do, and switch. By default
class member functions have access to this.
What do you think?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_761_141696358.1406238202054
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I propose having the ability to create a scope with access=
to an objects members.<div><br></div><div><b>This example explains itself:=
</b><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"subprettyprint"><div class=3D"subprett=
yprint"><font color=3D"#660066">struct Person {</font></div><div class=3D"s=
ubprettyprint"><font color=3D"#660066"><span class=3D"Apple-tab-span" style=
=3D"white-space:pre"> </span>string name;</font></div><div class=3D"subpret=
typrint"><font color=3D"#660066"><span class=3D"Apple-tab-span" style=3D"wh=
ite-space:pre"> </span>int age;</font></div><div class=3D"subprettyprint"><=
font color=3D"#660066">};</font></div><div class=3D"subprettyprint"><font c=
olor=3D"#660066"><br></font></div><div class=3D"subprettyprint"><font color=
=3D"#660066">Person person;</font></div><div class=3D"subprettyprint"><font=
color=3D"#660066"><br>// Creating a new scope with access to an objects me=
mbers</font></div><div class=3D"subprettyprint"><font color=3D"#660066">per=
son.{</font></div><div class=3D"subprettyprint"><font color=3D"#660066"><sp=
an class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>if(name =3D=
=3D "gord") {</font></div><div class=3D"subprettyprint"><font color=3D"#660=
066"><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>age =
=3D 99;</font></div><div class=3D"subprettyprint"><font color=3D"#660066"><=
span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>}</font></d=
iv><div class=3D"subprettyprint"><font color=3D"#660066">}<br><br>// Functi=
on with access to an objects members<br>void Func() person.{<br></font><spa=
n class=3D"Apple-tab-span" style=3D"color: rgb(102, 0, 102); white-space: p=
re;"> </span>age +=3D 2;<font color=3D"#660066"><br>}<br><br>// Lambda with=
access to an objects members<br>auto Lambda =3D [] person.{<br></font><spa=
n class=3D"Apple-tab-span" style=3D"color: rgb(102, 0, 102); white-space: p=
re;"> </span>age -=3D 2;<font color=3D"#660066"><br>};</font></div></div></=
code></div><br>It would also work with <font face=3D"courier new, monospace=
">if</font>, <font face=3D"courier new, monospace">else</font>, <font face=
=3D"courier new, monospace">for</font>, <font face=3D"courier new, monospac=
e">while</font>, <font face=3D"courier new, monospace">do</font>, and <font=
face=3D"courier new, monospace">switch</font>. By default class member fun=
ctions have access to <font face=3D"courier new, monospace">this</font>.</d=
iv></div><div><br></div><div>What do you think?</div></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_761_141696358.1406238202054--
.
Author: "Ryan P. Nicholl" <r.p.nicholl@gmail.com>
Date: Thu, 24 Jul 2014 17:50:43 -0400
Raw View
Interesting idea, but the syntax is weird. That should be in a capture group.
On July 24, 2014 5:43:22 PM EDT, Ezekiel Warren <zekewarren@gmail.com> wrote:
>I propose having the ability to create a scope with access to an
>objects
>members.
>
>*This example explains itself:*
>struct Person {
>string name;
>int age;
>};
>
>Person person;
>
>// Creating a new scope with access to an objects members
>person.{
>if(name == "gord") {
>age = 99;
>}
>}
>
>// Function with access to an objects members
>void Func() person.{
>age += 2;
>}
>
>// Lambda with access to an objects members
>auto Lambda = [] person.{
>age -= 2;
>};
>
>It would also work with if, else, for, while, do, and switch. By
>default
>class member functions have access to this.
>
>What do you think?
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: morwenn29@gmail.com
Date: Thu, 24 Jul 2014 15:01:10 -0700 (PDT)
Raw View
------=_Part_754_2056428126.1406239270638
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
The Game Maker Language (yes, the language used by Game Maker) has=20
something akin to what you propose:
with (person)
{
if (name =3D=3D "gord")
{
age =3D 99;
}
}
Le jeudi 24 juillet 2014 23:43:22 UTC+2, Ezekiel Warren a =C3=A9crit :
>
> I propose having the ability to create a scope with access to an objects=
=20
> members.
>
> *This example explains itself:*
> struct Person {
> string name;
> int age;
> };
>
> Person person;
>
> // Creating a new scope with access to an objects members
> person.{
> if(name =3D=3D "gord") {
> age =3D 99;
> }
> }
>
> // Function with access to an objects members
> void Func() person.{
> age +=3D 2;
> }
>
> // Lambda with access to an objects members
> auto Lambda =3D [] person.{
> age -=3D 2;
> };
>
> It would also work with if, else, for, while, do, and switch. By default=
=20
> class member functions have access to this.
>
> What do you think?
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_754_2056428126.1406239270638
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">The Game Maker Language (yes, the language used by Game Ma=
ker) has something akin to what you propose:<br><br><div style=3D"margin-le=
ft: 40px;"><font face=3D"courier new,monospace">with (person)<br>{<br> =
; if (name =3D=3D "gord")<br> {<br> &nbs=
p; age =3D 99;<br> }<br>}<b=
r></font></div><br>Le jeudi 24 juillet 2014 23:43:22 UTC+2, Ezekiel Warren =
a =C3=A9crit :<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">I propose having the ability to create a scope with access to an obje=
cts members.<div><br></div><div><b>This example explains itself:</b><div><d=
iv style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;backgrou=
nd-color:rgb(250,250,250)"><code><div><div><font color=3D"#660066">struct P=
erson {</font></div><div><font color=3D"#660066"><span style=3D"white-space=
:pre"> </span>string name;</font></div><div><font color=3D"#660066"><span s=
tyle=3D"white-space:pre"> </span>int age;</font></div><div><font color=3D"#=
660066">};</font></div><div><font color=3D"#660066"><br></font></div><div><=
font color=3D"#660066">Person person;</font></div><div><font color=3D"#6600=
66"><br>// Creating a new scope with access to an objects members</font></d=
iv><div><font color=3D"#660066">person.{</font></div><div><font color=3D"#6=
60066"><span style=3D"white-space:pre"> </span>if(name =3D=3D "gord") {</fo=
nt></div><div><font color=3D"#660066"><span style=3D"white-space:pre"> </s=
pan>age =3D 99;</font></div><div><font color=3D"#660066"><span style=3D"whi=
te-space:pre"> </span>}</font></div><div><font color=3D"#660066">}<br><br>/=
/ Function with access to an objects members<br>void Func() person.{<br></f=
ont><span style=3D"color:rgb(102,0,102);white-space:pre"> </span>age +=3D 2=
;<font color=3D"#660066"><br>}<br><br>// Lambda with access to an objects m=
embers<br>auto Lambda =3D [] person.{<br></font><span style=3D"color:rgb(10=
2,0,102);white-space:pre"> </span>age -=3D 2;<font color=3D"#660066"><br>};=
</font></div></div></code></div><br>It would also work with <font face=3D"c=
ourier new, monospace">if</font>, <font face=3D"courier new, monospace">els=
e</font>, <font face=3D"courier new, monospace">for</font>, <font face=3D"c=
ourier new, monospace">while</font>, <font face=3D"courier new, monospace">=
do</font>, and <font face=3D"courier new, monospace">switch</font>. By defa=
ult class member functions have access to <font face=3D"courier new, monosp=
ace">this</font>.</div></div><div><br></div><div>What do you think?</div></=
div></blockquote></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_754_2056428126.1406239270638--
.
Author: inkwizytoryankes@gmail.com
Date: Thu, 24 Jul 2014 15:24:59 -0700 (PDT)
Raw View
------=_Part_5_1130337713.1406240699167
Content-Type: text/plain; charset=UTF-8
Pascal and JavaScript have it too but both discourage usage of this. Main
problem is when class definition remove member, code could still compile
because another variable replace it.
On Thursday, July 24, 2014 11:43:22 PM UTC+2, Ezekiel Warren wrote:
>
> I propose having the ability to create a scope with access to an objects
> members.
>
> *This example explains itself:*
> struct Person {
> string name;
> int age;
> };
>
> Person person;
>
> // Creating a new scope with access to an objects members
> person.{
> if(name == "gord") {
> age = 99;
> }
> }
>
> // Function with access to an objects members
> void Func() person.{
> age += 2;
> }
>
> // Lambda with access to an objects members
> auto Lambda = [] person.{
> age -= 2;
> };
>
> It would also work with if, else, for, while, do, and switch. By default
> class member functions have access to this.
>
> What do you think?
>
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_5_1130337713.1406240699167
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Pascal and JavaScript have it too but both discourage usag=
e of this. Main problem is when class definition remove member, code could =
still compile because another variable replace it.<br><br>On Thursday, July=
24, 2014 11:43:22 PM UTC+2, Ezekiel Warren wrote:<blockquote class=3D"gmai=
l_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;=
padding-left: 1ex;"><div dir=3D"ltr">I propose having the ability to create=
a scope with access to an objects members.<div><br></div><div><b>This exam=
ple explains itself:</b><div><div style=3D"border:1px solid rgb(187,187,187=
);word-wrap:break-word;background-color:rgb(250,250,250)"><code><div><div><=
font color=3D"#660066">struct Person {</font></div><div><font color=3D"#660=
066"><span style=3D"white-space:pre"> </span>string name;</font></div><div>=
<font color=3D"#660066"><span style=3D"white-space:pre"> </span>int age;</f=
ont></div><div><font color=3D"#660066">};</font></div><div><font color=3D"#=
660066"><br></font></div><div><font color=3D"#660066">Person person;</font>=
</div><div><font color=3D"#660066"><br>// Creating a new scope with access =
to an objects members</font></div><div><font color=3D"#660066">person.{</fo=
nt></div><div><font color=3D"#660066"><span style=3D"white-space:pre"> </sp=
an>if(name =3D=3D "gord") {</font></div><div><font color=3D"#660066"><span =
style=3D"white-space:pre"> </span>age =3D 99;</font></div><div><font color=
=3D"#660066"><span style=3D"white-space:pre"> </span>}</font></div><div><fo=
nt color=3D"#660066">}<br><br>// Function with access to an objects members=
<br>void Func() person.{<br></font><span style=3D"color:rgb(102,0,102);whit=
e-space:pre"> </span>age +=3D 2;<font color=3D"#660066"><br>}<br><br>// Lam=
bda with access to an objects members<br>auto Lambda =3D [] person.{<br></f=
ont><span style=3D"color:rgb(102,0,102);white-space:pre"> </span>age -=3D 2=
;<font color=3D"#660066"><br>};</font></div></div></code></div><br>It would=
also work with <font face=3D"courier new, monospace">if</font>, <font face=
=3D"courier new, monospace">else</font>, <font face=3D"courier new, monospa=
ce">for</font>, <font face=3D"courier new, monospace">while</font>, <font f=
ace=3D"courier new, monospace">do</font>, and <font face=3D"courier new, mo=
nospace">switch</font>. By default class member functions have access to <f=
ont face=3D"courier new, monospace">this</font>.</div></div><div><br></div>=
<div>What do you think?</div></div></blockquote></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_5_1130337713.1406240699167--
.
Author: David Krauss <potswa@gmail.com>
Date: Fri, 25 Jul 2014 06:56:27 +0800
Raw View
Pascal has it; JavaScript has a bastardized version (as it does of everything).
I don't really see the problem, although I haven't ever really used it either. You could say the same of member functions with their implicit access to nonstatic members, if a member is removed which aliases something from the enclosing scope.
It's something to keep in mind for an extension method proposal. A local extension method could have unqualified access to members of the extended class, effectively becoming a with-block.
On 2014-07-25, at 6:24 AM, inkwizytoryankes@gmail.com wrote:
> Pascal and JavaScript have it too but both discourage usage of this. Main problem is when class definition remove member, code could still compile because another variable replace it.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Thu, 24 Jul 2014 17:01:18 -0700
Raw View
On Friday 25 July 2014 06:56:27 David Krauss wrote:
> It's something to keep in mind for an extension method proposal. A local
> extension method could have unqualified access to members of the extended
> class, effectively becoming a with-block.
Does it get to access privates too?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: David Krauss <potswa@gmail.com>
Date: Fri, 25 Jul 2014 09:18:13 +0800
Raw View
On 2014-07-25, at 8:01 AM, Thiago Macieira <thiago@macieira.org> wrote:
> On Friday 25 July 2014 06:56:27 David Krauss wrote:
>> It's something to keep in mind for an extension method proposal. A local
>> extension method could have unqualified access to members of the extende=
d
>> class, effectively becoming a with-block.
>=20
> Does it get to access privates too?
That's for the proposal author to decide :P .
Most likely, extension methods should follow something like inheritance rul=
es, so the access would be the same as a derived class defined in the same =
context. I don't know whether a derived local class benefits from private a=
ccess privileges of the enclosing scope, and I'm too lazy to check right no=
w. If it doesn't, that could be a defect, and if it does, I doubt implement=
ations agree since nobody does such a thing yet.
My current sense of extension methods is that they could be a kind of opaqu=
e typedef. I wrote a message to the group a couple weeks ago but there was =
no reply. Anyway, the particular mechanism isn't very important.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: Andrew Tomazos <andrewtomazos@gmail.com>
Date: Sat, 26 Jul 2014 12:40:27 +0200
Raw View
--90e6ba1efb747252da04ff16518d
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I just asked the commitee the other day if something like the Pascal
with-statement had been proposed for C++ and if not, if there was any
interest. Dr Stroustrup said that it had been proposed before and there
wasn't any interest. Sorry.
On Jul 25, 2014 12:01 AM, <morwenn29@gmail.com> wrote:
> The Game Maker Language (yes, the language used by Game Maker) has
> something akin to what you propose:
>
> with (person)
> {
> if (name =3D=3D "gord")
> {
> age =3D 99;
> }
> }
>
> Le jeudi 24 juillet 2014 23:43:22 UTC+2, Ezekiel Warren a =C3=A9crit :
>>
>> I propose having the ability to create a scope with access to an objects
>> members.
>>
>> *This example explains itself:*
>> struct Person {
>> string name;
>> int age;
>> };
>>
>> Person person;
>>
>> // Creating a new scope with access to an objects members
>> person.{
>> if(name =3D=3D "gord") {
>> age =3D 99;
>> }
>> }
>>
>> // Function with access to an objects members
>> void Func() person.{
>> age +=3D 2;
>> }
>>
>> // Lambda with access to an objects members
>> auto Lambda =3D [] person.{
>> age -=3D 2;
>> };
>>
>> It would also work with if, else, for, while, do, and switch. By default
>> class member functions have access to this.
>>
>> What do you think?
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--90e6ba1efb747252da04ff16518d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<p dir=3D"ltr">I just asked the commitee the other day if something like th=
e Pascal with-statement had been proposed for C++ and if not, if there was =
any interest.=C2=A0 Dr Stroustrup said that it had been proposed before and=
there wasn't any interest.=C2=A0 Sorry.</p>
<div class=3D"gmail_quote">On Jul 25, 2014 12:01 AM, <<a href=3D"mailto=
:morwenn29@gmail.com">morwenn29@gmail.com</a>> wrote:<br type=3D"attribu=
tion"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr">The Game Maker Language (yes, the language used by Game Ma=
ker) has something akin to what you propose:<br><br><div style=3D"margin-le=
ft:40px"><font face=3D"courier new,monospace">with (person)<br>{<br>=C2=A0=
=C2=A0=C2=A0 if (name =3D=3D "gord")<br>
=C2=A0=C2=A0=C2=A0 {<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 age =3D =
99;<br>=C2=A0=C2=A0=C2=A0 }<br>}<br></font></div><br>Le jeudi 24 juillet 20=
14 23:43:22 UTC+2, Ezekiel Warren a =C3=A9crit=C2=A0:<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">I propose having the ability to create a scope with access=
to an objects members.<div><br></div><div><b>This example explains itself:=
</b><div><div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-wo=
rd;background-color:rgb(250,250,250)">
<code><div><div><font color=3D"#660066">struct Person {</font></div><div><f=
ont color=3D"#660066"><span style=3D"white-space:pre-wrap"> </span>string n=
ame;</font></div><div><font color=3D"#660066"><span style=3D"white-space:pr=
e-wrap"> </span>int age;</font></div>
<div><font color=3D"#660066">};</font></div><div><font color=3D"#660066"><b=
r></font></div><div><font color=3D"#660066">Person person;</font></div><div=
><font color=3D"#660066"><br>// Creating a new scope with access to an obje=
cts members</font></div>
<div><font color=3D"#660066">person.{</font></div><div><font color=3D"#6600=
66"><span style=3D"white-space:pre-wrap"> </span>if(name =3D=3D "gord&=
quot;) {</font></div><div><font color=3D"#660066"><span style=3D"white-spac=
e:pre-wrap"> </span>age =3D 99;</font></div>
<div><font color=3D"#660066"><span style=3D"white-space:pre-wrap"> </span>}=
</font></div><div><font color=3D"#660066">}<br><br>// Function with access =
to an objects members<br>void Func() person.{<br></font><span style=3D"colo=
r:rgb(102,0,102);white-space:pre-wrap"> </span>age +=3D 2;<font color=3D"#6=
60066"><br>
}<br><br>// Lambda with access to an objects members<br>auto Lambda =3D [] =
person.{<br></font><span style=3D"color:rgb(102,0,102);white-space:pre-wrap=
"> </span>age -=3D 2;<font color=3D"#660066"><br>};</font></div></div></cod=
e></div>
<br>It would also work with <font face=3D"courier new, monospace">if</font>=
, <font face=3D"courier new, monospace">else</font>, <font face=3D"courier =
new, monospace">for</font>, <font face=3D"courier new, monospace">while</fo=
nt>, <font face=3D"courier new, monospace">do</font>, and <font face=3D"cou=
rier new, monospace">switch</font>. By default class member functions have =
access to <font face=3D"courier new, monospace">this</font>.</div>
</div><div><br></div><div>What do you think?</div></div></blockquote></div>
<p></p>
-- <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+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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</blockquote></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--90e6ba1efb747252da04ff16518d--
.
Author: Stack Machine <stackmachine@hotmail.com>
Date: Mon, 28 Jul 2014 19:09:01 -0700 (PDT)
Raw View
------=_Part_512_599913320.1406599741198
Content-Type: text/plain; charset=UTF-8
Just require the dot Operator to avoid the problem with removed members.
with(foo)
{
.x += 42;
}
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_512_599913320.1406599741198
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Just require the dot Operator to avoid the problem with re=
moved members.<br><div class=3D"prettyprint" style=3D"background-color: rgb=
(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; bor=
der-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div cl=
ass=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">with</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">foo</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br> </span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">x </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">+=3D</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">42</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></co=
de></div><br><br></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_512_599913320.1406599741198--
.
Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Tue, 29 Jul 2014 11:12:16 +0200
Raw View
This is a multi-part message in MIME format.
--------------010401030504040104070408
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Le 29/07/14 04:09, Stack Machine a =C3=A9crit :
> Just require the dot Operator to avoid the problem with removed members.
> |
> with(foo)
> {
> .x +=3D42;
> }
> |
>
>
>
Yes, this is better. However we can already do the following
|
{
| auto &_ =3D foo;
|_.x +=3D42;
}
|
Vicente
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--------------010401030504040104070408
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3DUTF-8" http-equiv=3D"Content-Type=
">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<div class=3D"moz-cite-prefix">Le 29/07/14 04:09, Stack Machine a
=C3=A9crit=C2=A0:<br>
</div>
<blockquote
cite=3D"mid:f73801ff-d9fd-4e72-9864-bc32e1bccd30@isocpp.org"
type=3D"cite">
<div dir=3D"ltr">Just require the dot Operator to avoid the problem
with removed members.<br>
<div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
250); border-color: rgb(187, 187, 187); border-style: solid;
border-width: 1px; word-wrap: break-word;"><code
class=3D"prettyprint">
<div class=3D"subprettyprint"><span style=3D"color: #008;"
class=3D"styled-by-prettify">with</span><span
style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span
style=3D"color: #000;" class=3D"styled-by-prettify">foo</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span
style=3D"color: #000;" class=3D"styled-by-prettify"><br>
</span><span style=3D"color: #660;"
class=3D"styled-by-prettify">{</span><span style=3D"color:
#000;" class=3D"styled-by-prettify"><br>
=C2=A0 =C2=A0 </span><span style=3D"color: #660;"
class=3D"styled-by-prettify">.</span><span style=3D"color:
#000;" class=3D"styled-by-prettify">x </span><span
style=3D"color: #660;" class=3D"styled-by-prettify">+=3D</s=
pan><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span
style=3D"color: #066;" class=3D"styled-by-prettify">42</spa=
n><span
style=3D"color: #660;" class=3D"styled-by-prettify">;</span=
><span
style=3D"color: #000;" class=3D"styled-by-prettify"><br>
</span><span style=3D"color: #660;"
class=3D"styled-by-prettify">}</span><span style=3D"color:
#000;" class=3D"styled-by-prettify"><br>
</span></div>
</code></div>
<br>
<br>
</div>
<br>
</blockquote>
Yes, this is better. However we can already do the following<br>
<span style=3D"color: #660;" class=3D"styled-by-prettify"></span><br>
<div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,
250); border-color: rgb(187, 187, 187); border-style: solid;
border-width: 1px; word-wrap: break-word;"><code
class=3D"prettyprint">
<div class=3D"subprettyprint"><span style=3D"color: #000;"
class=3D"styled-by-prettify"></span><span style=3D"color: #660;=
"
class=3D"styled-by-prettify">{</span><br>
<code class=3D"prettyprint">=C2=A0=C2=A0=C2=A0 auto &<span st=
yle=3D"color:
#660;" class=3D"styled-by-prettify"></span><span
style=3D"color: #000;" class=3D"styled-by-prettify"> _ =3D fo=
o;<br>
</span></code><span style=3D"color: #000;"
class=3D"styled-by-prettify">=C2=A0 =C2=A0 </span><span style=
=3D"color:
#660;" class=3D"styled-by-prettify">_.</span><span
style=3D"color: #000;" class=3D"styled-by-prettify">x </span><s=
pan
style=3D"color: #660;" class=3D"styled-by-prettify">+=3D</span>=
<span
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an
style=3D"color: #066;" class=3D"styled-by-prettify">42</span><s=
pan
style=3D"color: #660;" class=3D"styled-by-prettify">;</span><sp=
an
style=3D"color: #000;" class=3D"styled-by-prettify"><br>
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
}</span><span
style=3D"color: #000;" class=3D"styled-by-prettify"><br>
</span></div>
</code></div>
<br>
<br>
Vicente<br>
</body>
</html>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--------------010401030504040104070408--
.
Author: Philip Polkovnikov <polkovnikov.ph@gmail.com>
Date: Tue, 29 Jul 2014 22:03:46 +0400
Raw View
--bcaec547cbcb60ea8304ff58dc5e
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
It's possible to stack with(...) scopes. One would have to use _1, _2 etc
in the Vincent's way. I love that dot-syntax. That's what I missed in old
good VB6 times.
2014-07-29 13:12 GMT+04:00 Vicente J. Botet Escriba <
vicente.botet@wanadoo.fr>:
> Le 29/07/14 04:09, Stack Machine a =C3=A9crit :
>
> Just require the dot Operator to avoid the problem with removed members.
> with(foo)
> {
> .x +=3D 42;
> }
>
>
>
> Yes, this is better. However we can already do the following
>
> {
> auto & _ =3D foo;
> _.x +=3D 42;
> }
>
>
> Vicente
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--bcaec547cbcb60ea8304ff58dc5e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">It's possible to stack with(...) scopes. One would hav=
e to use _1, _2 etc in the Vincent's way. I love that dot-syntax. That&=
#39;s what I missed in old good VB6 times.</div><div class=3D"gmail_extra">=
<br>
<br><div class=3D"gmail_quote">2014-07-29 13:12 GMT+04:00 Vicente J. Botet =
Escriba <span dir=3D"ltr"><<a href=3D"mailto:vicente.botet@wanadoo.fr" t=
arget=3D"_blank">vicente.botet@wanadoo.fr</a>></span>:<br><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">
<div>Le 29/07/14 04:09, Stack Machine a
=C3=A9crit=C2=A0:<br>
</div><div class=3D"">
<blockquote type=3D"cite">
<div dir=3D"ltr">Just require the dot Operator to avoid the problem
with removed members.<br>
<div style=3D"background-color:rgb(250,250,250);border-color:rgb(18=
7,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
<div><span style=3D"color:#008">with</span><span style=3D"color=
:#660">(</span><span style=3D"color:#000">foo</span><span style=3D"color:#6=
60">)</span><span style=3D"color:#000"><br>
</span><span style=3D"color:#660">{</span><span style=3D"colo=
r:#000"><br>
=C2=A0 =C2=A0 </span><span style=3D"color:#660">.</span><sp=
an style=3D"color:#000">x </span><span style=3D"color:#660">+=3D</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#066">42</span><span st=
yle=3D"color:#660">;</span><span style=3D"color:#000"><br>
</span><span style=3D"color:#660">}</span><span style=3D"colo=
r:#000"><br>
</span></div>
</code></div>
<br>
<br>
</div>
<br>
</blockquote></div>
Yes, this is better. However we can already do the following<br>
<span style=3D"color:#660"></span><br>
<div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
<div><span style=3D"color:#000"></span><span style=3D"color:#660">{=
</span><br>
<code>=C2=A0=C2=A0=C2=A0 auto &<span style=3D"color:#660"></s=
pan><span style=3D"color:#000"> _ =3D foo;<br>
</span></code><span style=3D"color:#000">=C2=A0 =C2=A0 </span><=
span style=3D"color:#660">_.</span><span style=3D"color:#000">x </span><spa=
n style=3D"color:#660">+=3D</span><span style=3D"color:#000"> </span><span =
style=3D"color:#066">42</span><span style=3D"color:#660">;</span><span styl=
e=3D"color:#000"><br>
</span><span style=3D"color:#660">}</span><span class=3D"HOEnZb">=
<font color=3D"#888888"><span style=3D"color:#000"><br>
</span></font></span></div><span class=3D"HOEnZb"><font color=3D"=
#888888">
</font></span></code></div><span class=3D"HOEnZb"><font color=3D"#888=
888">
<br>
<br>
Vicente<br>
</font></span></div><div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
-- <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+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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--bcaec547cbcb60ea8304ff58dc5e--
.
Author: jgottman6@gmail.com
Date: Tue, 29 Jul 2014 15:35:24 -0700 (PDT)
Raw View
------=_Part_423_1230742303.1406673324494
Content-Type: text/plain; charset=UTF-8
On Monday, July 28, 2014 10:09:01 PM UTC-4, Stack Machine wrote:
>
> Just require the dot Operator to avoid the problem with removed members.
> with(foo)
> {
> .x += 42;
> }
>
>
> I have a could of questions:
1) How would this interact with brackets and parentheses? Would this code
be legal?
std::string foo = "abc";
with (foo) {
std::cout << "First character = " << .[0] << "\n";
}
2) If we use an rvalue as the parameter of the "with" statement, will it
remain alive until the closing bracket?
with (get_string()) {
std::cerr << "Size = " << .size() << "\n";
}
Joe Gottman
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_423_1230742303.1406673324494
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Monday, July 28, 2014 10:09:01 PM UTC-4, Stack =
Machine wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
>Just require the dot Operator to avoid the problem with removed members.<b=
r><div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,=
187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><=
span style=3D"color:#008">with</span><span style=3D"color:#660">(</span><sp=
an style=3D"color:#000">foo</span><span style=3D"color:#660">)</span><span =
style=3D"color:#000"><br></span><span style=3D"color:#660">{</span><span st=
yle=3D"color:#000"><br> </span><span style=3D"color:#660">.</s=
pan><span style=3D"color:#000">x </span><span style=3D"color:#660">+=3D</sp=
an><span style=3D"color:#000"> </span><span style=3D"color:#066">42</span><=
span style=3D"color:#660">;</span><span style=3D"color:#000"><br></span><sp=
an style=3D"color:#660">}</span><span style=3D"color:#000"><br></span></div=
></code></div><br><br></div></blockquote><div>I have a could of questions:<=
br><br>1) How would this interact with brackets and parentheses? Woul=
d this code be legal?<br><div class=3D"prettyprint" style=3D"background-col=
or: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: sol=
id; border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint">=
<div class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-=
by-prettify">std</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">::</span><span style=3D"color: #008;" class=3D"styled-by-prettify">st=
ring</span><span style=3D"color: #000;" class=3D"styled-by-prettify">  =
;foo </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #080;" class=3D"styled-by-prettify">"abc"</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">with</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">foo</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br> std</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify">cout </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify"><<</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #080;" class=3D"styled-by-prettify">"First character =3D "</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify"><<</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;"=
class=3D"styled-by-prettify">.[</span><span style=3D"color: #066;" class=
=3D"styled-by-prettify">0</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">]</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify"><=
;<</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #080;" class=3D"styled-by-prettify">"\n"</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br></span></div></code></div><br> 2) =
If we use an rvalue as the parameter of the "with" statement, will it remai=
n alive until the closing bracket?<br><div class=3D"prettyprint" style=3D"b=
ackground-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); bord=
er-style: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"=
prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">with</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">get_string</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">())</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br> std</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">cerr </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify"><<</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #080;" class=3D"styled-by-prettify">"Size =3D "</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;"=
class=3D"styled-by-prettify"><<</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">.</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">size</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">()</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify"><<</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #080;" class=3D"styled-by-prettify">"\n"</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br><br></span></div></code></div><br>Joe Gottman<b=
r></div></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_423_1230742303.1406673324494--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Wed, 30 Jul 2014 10:44:38 +0200
Raw View
--047d7b3a977899c2db04ff652abd
Content-Type: text/plain; charset=UTF-8
I don't see what this feature is supposed to fix or improve exactly.
Did I miss a rational?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--047d7b3a977899c2db04ff652abd
Content-Type: text/html; charset=UTF-8
<div dir="ltr">I don't see what this feature is supposed to fix or improve exactly.<div>Did I miss a rational?</div><div><br></div><div><br><div class="gmail_extra"><br></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
--047d7b3a977899c2db04ff652abd--
.
Author: Philipp Stephani <p.stephani2@gmail.com>
Date: Wed, 30 Jul 2014 10:51:28 +0000
Raw View
--001a1135e2de3240ce04ff66f0d1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
In VB6 the with statement was more useful because VB6 didn't have reference
types or type inference. In C++11, you can do:
auto& x =3D <complex expression>;
which only requires a small number of additional keystrokes, but no new
grammar rules. I think the benefit is too small to warrant a change to the
grammar.
Furthermore the dot syntax will hopefully be used for designated
initializers (already present in C and as an extension in Clang and GCC):
with (x) T { .foo =3D bar } // designated initializer or 'operator=3D(x.foo=
,
bar)'?
Philip Polkovnikov <polkovnikov.ph@gmail.com> schrieb am Tue Jul 29 2014 at
20:03:47:
> It's possible to stack with(...) scopes. One would have to use _1, _2 etc
> in the Vincent's way. I love that dot-syntax. That's what I missed in old
> good VB6 times.
>
>
> 2014-07-29 13:12 GMT+04:00 Vicente J. Botet Escriba <
> vicente.botet@wanadoo.fr>:
>
> Le 29/07/14 04:09, Stack Machine a =C3=A9crit :
>>
>> Just require the dot Operator to avoid the problem with removed members.
>> with(foo)
>> {
>> .x +=3D 42;
>> }
>>
>>
>>
>> Yes, this is better. However we can already do the following
>>
>> {
>> auto & _ =3D foo;
>> _.x +=3D 42;
>> }
>>
>>
>> Vicente
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> email to std-proposals+unsubscribe@isocpp.org.
>> To post to this group, send email to std-proposals@isocpp.org.
>> Visit this group at
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--001a1135e2de3240ce04ff66f0d1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
In VB6 the with statement was more useful because VB6 didn't have refer=
ence types or type inference. In C++11, you can do:<div><br></div><div>auto=
& x =3D <complex expression>;</div><div><br></div><div>which only=
requires a small number of additional keystrokes, but no new grammar rules=
.. I think the benefit is too small to warrant a change to the grammar.</div=
>
<div><br></div><div>Furthermore the dot syntax will hopefully be used for d=
esignated initializers (already present in C and as an extension in Clang a=
nd GCC):</div><div><br></div><div>with (x) T { .foo =3D bar } // designated=
initializer or 'operator=3D(x.foo, bar)'?</div>
<div><br><div class=3D"gmail_quote">Philip Polkovnikov <<a href=3D"mailt=
o:polkovnikov.ph@gmail.com">polkovnikov.ph@gmail.com</a>> schrieb am Tue=
Jul 29 2014 at 20:03:47:<br><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr">It's possible to stack with(...) scopes. One would hav=
e to use _1, _2 etc in the Vincent's way. I love that dot-syntax. That&=
#39;s what I missed in old good VB6 times.</div><div class=3D"gmail_extra">
<br>
<br><div class=3D"gmail_quote">2014-07-29 13:12 GMT+04:00 Vicente J. Botet =
Escriba <span dir=3D"ltr"><<a href=3D"mailto:vicente.botet@wanadoo.fr" t=
arget=3D"_blank">vicente.botet@wanadoo.fr</a>></span>:</div></div><div c=
lass=3D"gmail_extra">
<div class=3D"gmail_quote"><br><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">
<div>Le 29/07/14 04:09, Stack Machine a
=C3=A9crit=C2=A0:<br>
</div><div>
<blockquote type=3D"cite">
<div dir=3D"ltr">Just require the dot Operator to avoid the problem
with removed members.<br>
<div style=3D"background-color:rgb(250,250,250);border-color:rgb(18=
7,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
<div><span style=3D"color:#008">with</span><span style=3D"color=
:#660">(</span><span style=3D"color:#000">foo</span><span style=3D"color:#6=
60">)</span><span style=3D"color:#000"><br>
</span><span style=3D"color:#660">{</span><span style=3D"colo=
r:#000"><br>
=C2=A0 =C2=A0 </span><span style=3D"color:#660">.</span><sp=
an style=3D"color:#000">x </span><span style=3D"color:#660">+=3D</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#066">42</span><span st=
yle=3D"color:#660">;</span><span style=3D"color:#000"><br>
</span><span style=3D"color:#660">}</span><span style=3D"colo=
r:#000"><br>
</span></div>
</code></div>
<br>
<br>
</div>
<br>
</blockquote></div>
Yes, this is better. However we can already do the following<br>
<span style=3D"color:#660"></span><br>
<div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,18=
7,187);border-style:solid;border-width:1px;word-wrap:break-word"><code>
<div><span style=3D"color:#000"></span><span style=3D"color:#660">{=
</span><br>
<code>=C2=A0=C2=A0=C2=A0 auto &<span style=3D"color:#660"></s=
pan><span style=3D"color:#000"> _ =3D foo;<br>
</span></code><span style=3D"color:#000">=C2=A0 =C2=A0 </span><=
span style=3D"color:#660">_.</span><span style=3D"color:#000">x </span><spa=
n style=3D"color:#660">+=3D</span><span style=3D"color:#000"> </span><span =
style=3D"color:#066">42</span><span style=3D"color:#660">;</span><span styl=
e=3D"color:#000"><br>
</span><span style=3D"color:#660">}</span><span><font color=3D"#8=
88888"><span style=3D"color:#000"><br>
</span></font></span></div><span><font color=3D"#888888">
</font></span></code></div><span><font color=3D"#888888">
<br>
<br>
Vicente<br>
</font></span></div><div><div>
<p></p>
-- <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+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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div></div>
<p></p>
-- <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+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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</blockquote></div></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a1135e2de3240ce04ff66f0d1--
.
Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Fri, 1 Aug 2014 03:26:34 -0700 (PDT)
Raw View
------=_Part_44_140922109.1406888794751
Content-Type: text/plain; charset=UTF-8
With regards to access privileges, allowing greater privileges than the
surrounding scope would surely be asking for trouble (e.g. any invariances
cannot be guaranteed by a class author).
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_44_140922109.1406888794751
Content-Type: text/html; charset=UTF-8
<div dir="ltr">With regards to access privileges, allowing greater privileges than the surrounding scope would surely be asking for trouble (e.g. any invariances cannot be guaranteed by a class author).</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
------=_Part_44_140922109.1406888794751--
.