Topic: Lambda "Injection/Inheritance/Override" function


Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
Date: Mon, 17 Jul 2017 15:52:38 -0700 (PDT)
Raw View
------=_Part_931_1916673437.1500331959076
Content-Type: multipart/alternative;
 boundary="----=_Part_932_615797490.1500331959076"

------=_Part_932_615797490.1500331959076
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



On Monday, July 17, 2017 at 6:09:25 AM UTC-7, Michael Davies wrote:
>
> Hey everyone,
>
> I would like to hear your thoughts on an idea I've been toiling away over=
..=20
> Playing around with some code I was curious if I could try to create a=20
> small library filled with a few classes and override the default function=
=20
> behaviour of those classes. This was for test purposes so I could have a=
=20
> similar sort of design where I work if it was useful. Through experimenti=
ng=20
> I got something like this which is honestly not ideal:
>

https://wandbox.org/permlink/B9u9orFV5Zd3L5Fi

What would be more ideal, is if I could create a new function without=20
> having to define and declare references to things within the class to mak=
e=20
> them available to the lambda.
>

You already can! The only problem with your existing code is that you're=20
trying to refer to private data members of your class from outside the=20
class, which is fundamentally never allowed in C++ because it would break=
=20
encapsulation. If you want those data members to be accessible by main(),=
=20
then you need to make them *public*, or else make main() a *friend* of your=
=20
class. Here's an example with "friend":

https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ

<https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
The relevant snippet is:

TEST.OverrideWinProcess( <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
    [&x =3D TEST]() { <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
        x.m_iWin +=3D 1; <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
        std::cout << "Overloaded: " << x.m_iWin << '\n';=20
<https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
    } <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
); <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>

If you're not a *friend* of the class, then of course you can't access its=
=20
private members; that's by design and will never, ever change.

HTH,
=E2=80=93Arthur

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/bf5cf039-c847-4de8-a08f-8660899103c9%40isocpp.or=
g.

------=_Part_932_615797490.1500331959076
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, July 17, 2017 at 6:09:25 AM UTC-7, Mich=
ael Davies 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">Hey everyone,<br><br>I would like to hear your thoughts on an idea I&#3=
9;ve been toiling away over. Playing around with some code I was curious if=
 I could try to create a small library filled with a few classes and overri=
de the default function behaviour of those classes. This was for test purpo=
ses so I could have a similar sort of design where I work if it was useful.=
 Through experimenting I got something like this which is honestly not idea=
l:<br></div></blockquote><div><br></div><div><a href=3D"https://wandbox.org=
/permlink/B9u9orFV5Zd3L5Fi">https://wandbox.org/permlink/B9u9orFV5Zd3L5Fi</=
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 di=
r=3D"ltr">What would be more ideal, is if I could create a new function wit=
hout having to define and declare references to things within the class to =
make them available to the lambda.</div></blockquote><div><br></div><div>Yo=
u already can! The only problem with your existing code is that you&#39;re =
trying to refer to private data members of your class from outside the clas=
s, which is fundamentally never allowed in C++ because it would break encap=
sulation. If you want those data members to be accessible by main(), then y=
ou need to make them <i><b>public</b></i>, or else make main() a <i><b>frie=
nd</b></i> of your class. Here&#39;s an example with &quot;friend&quot;:</d=
iv><div><br></div><div><a href=3D"https://wandbox.org/permlink/0KlqS0oL3H3B=
vaaQ">https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ<br></a></div><div><a hr=
ef=3D"https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ"><br></a></div><div><di=
v>The relevant snippet is:</div><div><br></div><font face=3D"courier new, m=
onospace"><a href=3D"https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ"> TEST.O=
verrideWinProcess(</a><br>=C2=A0 =C2=A0=C2=A0<a href=3D"https://wandbox.org=
/permlink/0KlqS0oL3H3BvaaQ">[&amp;x =3D TEST]() {</a><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0=C2=A0<a href=3D"https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ">x=
..m_iWin +=3D 1;</a><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0<a href=3D"https://=
wandbox.org/permlink/0KlqS0oL3H3BvaaQ">std::cout &lt;&lt; &quot;Overloaded:=
 &quot; &lt;&lt; x.m_iWin &lt;&lt; &#39;\n&#39;;</a><br>=C2=A0 =C2=A0=C2=A0=
<a href=3D"https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ">}</a><br><a href=
=3D"https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ"> );</a></font></div><div=
><br></div><div>If you&#39;re not a <b>friend</b> of the class, then of cou=
rse you can&#39;t access its private members; that&#39;s by design and will=
 never, ever change.</div><div><br></div><div>HTH,</div><div>=E2=80=93Arthu=
r</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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/bf5cf039-c847-4de8-a08f-8660899103c9%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/bf5cf039-c847-4de8-a08f-8660899103c9=
%40isocpp.org</a>.<br />

------=_Part_932_615797490.1500331959076--

------=_Part_931_1916673437.1500331959076--

.


Author: "'Michael Davies' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 17 Jul 2017 16:08:13 -0700 (PDT)
Raw View
------=_Part_943_1160982901.1500332893513
Content-Type: multipart/alternative;
 boundary="----=_Part_944_1060658338.1500332893513"

------=_Part_944_1060658338.1500332893513
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Arthur,

Thanks for the response! In regards to this, I was thinking more along the=
=20
lines of treating the lambda function as if you were actually defining a=20
function definition within the class. So:

[] () {=20
m_iWin +=3D1;
std::cout << "Overloaded: " << m_iWin << '\n';
}

Would be more equivalent to treating the lambda function as if it were a=20
direct function definition:

TestOverride::winProcess(){
    m_iWin +=3D 1;
    std::cout << "Overloaded: " << m_iWin << '\n';
}

Perhaps there should be some way of defining the lambda as if it were=20
actually a function that was part of the class? Rather than those data=20
members being accessible by main() they are only accessible within the very=
=20
lambda you create rather than accessible by main().

On Monday, July 17, 2017 at 11:52:39 PM UTC+1, Arthur O'Dwyer wrote:
>
>
>
> On Monday, July 17, 2017 at 6:09:25 AM UTC-7, Michael Davies wrote:
>>
>> Hey everyone,
>>
>> I would like to hear your thoughts on an idea I've been toiling away=20
>> over. Playing around with some code I was curious if I could try to crea=
te=20
>> a small library filled with a few classes and override the default funct=
ion=20
>> behaviour of those classes. This was for test purposes so I could have a=
=20
>> similar sort of design where I work if it was useful. Through experiment=
ing=20
>> I got something like this which is honestly not ideal:
>>
>
> https://wandbox.org/permlink/B9u9orFV5Zd3L5Fi
>
> What would be more ideal, is if I could create a new function without=20
>> having to define and declare references to things within the class to ma=
ke=20
>> them available to the lambda.
>>
>
> You already can! The only problem with your existing code is that you're=
=20
> trying to refer to private data members of your class from outside the=20
> class, which is fundamentally never allowed in C++ because it would break=
=20
> encapsulation. If you want those data members to be accessible by main(),=
=20
> then you need to make them *public*, or else make main() a *friend* of=20
> your class. Here's an example with "friend":
>
> https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ
>
> <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
> The relevant snippet is:
>
> TEST.OverrideWinProcess( <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
>     [&x =3D TEST]() { <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
>         x.m_iWin +=3D 1; <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
>         std::cout << "Overloaded: " << x.m_iWin << '\n';=20
> <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
>     } <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
> ); <https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ>
>
> If you're not a *friend* of the class, then of course you can't access=20
> its private members; that's by design and will never, ever change.
>
> HTH,
> =E2=80=93Arthur
>

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/85d371d4-0fa1-470a-9e02-559dd5415857%40isocpp.or=
g.

------=_Part_944_1060658338.1500332893513
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Arthur,<div><br></div><div>Thanks for the response! In =
regards to this, I was thinking more along the lines of treating the lambda=
 function as if you were actually defining a function definition within the=
 class. So:<br><br><div class=3D"prettyprint" style=3D"background-color: rg=
b(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; bo=
rder-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div c=
lass=3D"subprettyprint"><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">[]</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"> </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> <br>m_iWin </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">+=3D</span><span style=3D"color: #=
066;" class=3D"styled-by-prettify">1</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br>std</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">cout </span><font color=3D"#666600"><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #080;" class=3D"style=
d-by-prettify">&quot;Overloaded: &quot;</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> m_iWin </span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #080;" class=3D"styled-by-prett=
ify">&#39;\n&#39;</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">;</span></font><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">}=
</span></div></code></div><br>Would be more equivalent to treating the lamb=
da=C2=A0function as if it were a direct function definition:</div><div><br>=
</div><div><div class=3D"prettyprint" style=3D"background-color: rgb(250, 2=
50, 250); border-color: rgb(187, 187, 187); border-style: solid; border-wid=
th: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"=
subprettyprint"><span style=3D"color: rgb(102, 0, 102);"><span style=3D"col=
or: #606;" class=3D"styled-by-prettify">TestOverride</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">winProcess</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">(){</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 m_iWin </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">+=3D</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" cl=
ass=3D"styled-by-prettify">1</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">cout </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> </span><span style=3D"color: #080;" class=3D"styled-by-prettify">&quo=
t;Overloaded: &quot;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
m_iWin </span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt=
;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #080;" class=3D"styled-by-prettify">&#39;\n&#39;</=
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><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">}</span></span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></code></di=
v><br>Perhaps there should be some way of defining the lambda as if it were=
 actually a function that was part of the class? Rather than those data mem=
bers being accessible by main() they are only accessible within the very la=
mbda you create rather than accessible by main().<br><br>On Monday, July 17=
, 2017 at 11:52:39 PM UTC+1, Arthur O&#39;Dwyer wrote:<blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;"><div dir=3D"ltr"><br><br>On Monday, July 17, 2017 a=
t 6:09:25 AM UTC-7, Michael Davies 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">Hey everyone,<br><br>I would like to hear your thoug=
hts on an idea I&#39;ve been toiling away over. Playing around with some co=
de I was curious if I could try to create a small library filled with a few=
 classes and override the default function behaviour of those classes. This=
 was for test purposes so I could have a similar sort of design where I wor=
k if it was useful. Through experimenting I got something like this which i=
s honestly not ideal:<br></div></blockquote><div><br></div><div><a href=3D"=
https://wandbox.org/permlink/B9u9orFV5Zd3L5Fi" target=3D"_blank" rel=3D"nof=
ollow" onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q\x3dhttp=
s%3A%2F%2Fwandbox.org%2Fpermlink%2FB9u9orFV5Zd3L5Fi\x26sa\x3dD\x26sntz\x3d1=
\x26usg\x3dAFQjCNGkWwyMO65b1G17-JmqKs9MamOkpA&#39;;return true;" onclick=3D=
"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwandbox.org=
%2Fpermlink%2FB9u9orFV5Zd3L5Fi\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGkWw=
yMO65b1G17-JmqKs9MamOkpA&#39;;return true;">https://wandbox.org/permlink/<w=
br>B9u9orFV5Zd3L5Fi</a></div><div><br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr">What would be more ideal, is if I could create a =
new function without having to define and declare references to things with=
in the class to make them available to the lambda.</div></blockquote><div><=
br></div><div>You already can! The only problem with your existing code is =
that you&#39;re trying to refer to private data members of your class from =
outside the class, which is fundamentally never allowed in C++ because it w=
ould break encapsulation. If you want those data members to be accessible b=
y main(), then you need to make them <i><b>public</b></i>, or else make mai=
n() a <i><b>friend</b></i> of your class. Here&#39;s an example with &quot;=
friend&quot;:</div><div><br></div><div><a href=3D"https://wandbox.org/perml=
ink/0KlqS0oL3H3BvaaQ" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"thi=
s.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fp=
ermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Ei=
pxiqmj8qLMHhcOBFHaKA&#39;;return true;" onclick=3D"this.href=3D&#39;https:/=
/www.google.com/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3=
BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&=
#39;;return true;">https://wandbox.org/permlink/<wbr>0KlqS0oL3H3BvaaQ<br></=
a></div><div><a href=3D"https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ" targ=
et=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.=
google.com/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ=
\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;=
return true;" onclick=3D"this.href=3D&#39;https://www.google.com/url?q\x3dh=
ttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x=
3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return true;"><br></a=
></div><div><div>The relevant snippet is:</div><div><br></div><font face=3D=
"courier new, monospace"><a href=3D"https://wandbox.org/permlink/0KlqS0oL3H=
3BvaaQ" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;=
https://www.google.com/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0Klq=
S0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcO=
BFHaKA&#39;;return true;" onclick=3D"this.href=3D&#39;https://www.google.co=
m/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3=
dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return tr=
ue;"> TEST.OverrideWinProcess(</a><br>=C2=A0 =C2=A0=C2=A0<a href=3D"https:/=
/wandbox.org/permlink/0KlqS0oL3H3BvaaQ" target=3D"_blank" rel=3D"nofollow" =
onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F=
%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26usg=
\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return true;" onclick=3D"this.h=
ref=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fperm=
link%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Eipxi=
qmj8qLMHhcOBFHaKA&#39;;return true;">[&amp;x =3D TEST]() {</a><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0=C2=A0<a href=3D"https://wandbox.org/permlink/0KlqS0oL3=
H3BvaaQ" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39=
;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0Kl=
qS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhc=
OBFHaKA&#39;;return true;" onclick=3D"this.href=3D&#39;https://www.google.c=
om/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x=
3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return t=
rue;">x.m_iWin +=3D 1;</a><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0<a href=3D"h=
ttps://wandbox.org/permlink/0KlqS0oL3H3BvaaQ" target=3D"_blank" rel=3D"nofo=
llow" onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q\x3dhttps=
%3A%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\=
x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return true;" onclick=3D"=
this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwandbox.org%=
2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy04=
5Eipxiqmj8qLMHhcOBFHaKA&#39;;return true;">std::cout &lt;&lt; &quot;Overloa=
ded: &quot; &lt;&lt; x.m_iWin &lt;&lt; &#39;\n&#39;;</a><br>=C2=A0 =C2=A0=
=C2=A0<a href=3D"https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ" target=3D"_=
blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.google.=
com/url?q\x3dhttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\=
x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return =
true;" onclick=3D"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A=
%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26=
usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return true;">}</a><br><a hr=
ef=3D"https://wandbox.org/permlink/0KlqS0oL3H3BvaaQ" target=3D"_blank" rel=
=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q\=
x3dhttps%3A%2F%2Fwandbox.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sn=
tz\x3d1\x26usg\x3dAFQjCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return true;" onc=
lick=3D"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwand=
box.org%2Fpermlink%2F0KlqS0oL3H3BvaaQ\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQ=
jCNGXy045Eipxiqmj8qLMHhcOBFHaKA&#39;;return true;"> );</a></font></div><div=
><br></div><div>If you&#39;re not a <b>friend</b> of the class, then of cou=
rse you can&#39;t access its private members; that&#39;s by design and will=
 never, ever change.</div><div><br></div><div>HTH,</div><div>=E2=80=93Arthu=
r</div></div></blockquote></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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/85d371d4-0fa1-470a-9e02-559dd5415857%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/85d371d4-0fa1-470a-9e02-559dd5415857=
%40isocpp.org</a>.<br />

------=_Part_944_1060658338.1500332893513--

------=_Part_943_1160982901.1500332893513--

.