Topic: Class extending with post-class declarations/definitions
Author: Nom <turbine1991@gmail.com>
Date: Sat, 29 Apr 2017 04:24:47 -0700 (PDT)
Raw View
------=_Part_152_445475722.1493465087068
Content-Type: multipart/alternative;
boundary="----=_Part_153_1027908459.1493465087068"
------=_Part_153_1027908459.1493465087068
Content-Type: text/plain; charset=UTF-8
Hi,
I'd like to propose a new versatile language construct for an idea. The
premise of this is to enable a class to be enriched after it's been
declared - as if you were modifying the source class directly. Think of it
as reversing a derived class to instead "enhance" or replace the parent
class.
This concept would be incredibly useful with reusable code bases, such as:
-Game engines, where developers traditionally have to tailor source to fit
their own purposes. With this proposal, developers could pull in updates in
a way which is decoupled from their own codebase, requiring one to only
compensate for structural changes.
-Incorporating 3rd-party header definitions into your project, such as a
physics library which provided a header-defined vector class - you could
enrich its functionality or overload it to make it play better with other
vector types.
-Creating fixes out-of-tree, you could create a patch containing code
pertaining to the component affected. While this is a lesser use-case, it
could potentially allow regression testing between old and new definitions
and allow streamlined merging of the newer and older code bases.
I hope we can all agree that a working implementation could potentially
save a lot of time and cost throughout a project's lifecycle.
Rules:
-Acts almost like a derived class, except the parent itself being derived
from all of the elaborated definitions.
-Able to replace virtual methods - minimum requirement.
-Able to replace public methods - ideal requirement. Detecting structural
changes would require an explicit "override" keyword, comparable to Java's.
Example code:
(Please use your imagination for more advanced use-cases)
class Vector2 {
public:
typedef double coord_t;
coord_t x, y;
Vector2(Vector2 parent): Vector2(parent.x, parent.y) {
}
Vector2(coord_t x, coord_t y): x(x), y(y) {
}
double getLength() { // Bug - returns incorrect value
return -1;
}
Vector2 getNormalised() {
double length = getLength();
return Vector2(x / length, y / length);
}
}
class PrimaryExtendVector2: elaborates public Vector2 {
public:
double getCrossProduct(Coord other) { // Provides new functionality
return (x * other.y) - (y * other.x);
}
PrimaryExtendVector2(coord_t x, coord_t y): Vector2(x, y) {
}
}
class SecondaryExtendVector2: elaborates public PrimaryExtendVector2 {
public:
double getLength() { // Fix bug - override
return sqrt((x ^ 2) + (y ^ 2));
}
}
--
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/af545d85-2927-460e-ac01-0d00f9ed0031%40isocpp.org.
------=_Part_153_1027908459.1493465087068
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi,</div><div>I'd like to propose a new versatile=
language construct for an idea. The premise of this is to enable a class t=
o be enriched after it's been declared - as if you were modifying the s=
ource class directly. Think of it as reversing a derived class to instead &=
quot;enhance" or replace the parent class.</div><div><br></div><div>Th=
is concept would be incredibly useful with reusable code bases, such as:</d=
iv><div>-Game engines, where developers traditionally have to tailor source=
to fit their own purposes. With this proposal, developers could pull in up=
dates in a way which is decoupled from their own codebase, requiring one to=
only compensate for structural changes.</div><div><br></div><div>-Incorpor=
ating 3rd-party header definitions into your project, such as a physics lib=
rary which provided a header-defined vector class - you could enrich its fu=
nctionality or overload it to make it play better with other vector types.<=
/div><div><br></div><div>-Creating fixes out-of-tree, you could create a pa=
tch containing code pertaining to the component affected. While this is a l=
esser use-case, it could potentially allow regression testing between old a=
nd new definitions and allow streamlined merging of the newer and older cod=
e bases.</div><div>=C2=A0</div><div>I hope we can all agree that a working =
implementation could potentially save a lot of time and cost throughout a p=
roject's lifecycle.</div><div><br></div><div>Rules:</div><div>-Acts alm=
ost like a derived class, except the parent itself being derived from all o=
f the elaborated definitions.</div><div>-Able to replace virtual methods - =
minimum requirement.</div><div>-Able to replace public methods - ideal requ=
irement. Detecting structural changes would require an explicit "overr=
ide" keyword, comparable to Java's.</div><div><br></div><div>Examp=
le code:</div><div>(Please use your imagination for more advanced use-cases=
)</div><div><br></div><div><div class=3D"prettyprint" style=3D"background-c=
olor: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: s=
olid; border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint=
"><div class=3D"subprettyprint"><font color=3D"#660066"><div class=3D"subpr=
ettyprint">class Vector2 {</div><div class=3D"subprettyprint">public:</div>=
<div class=3D"subprettyprint">=C2=A0 typedef double coord_t;</div><div clas=
s=3D"subprettyprint">=C2=A0=C2=A0</div><div class=3D"subprettyprint">=C2=A0=
coord_t x, y;</div><div class=3D"subprettyprint"><br></div><div class=3D"s=
ubprettyprint">=C2=A0 Vector2(Vector2 parent): Vector2(parent.x, parent.y) =
{</div><div class=3D"subprettyprint">=C2=A0 }</div><div class=3D"subprettyp=
rint">=C2=A0=C2=A0</div><div class=3D"subprettyprint">=C2=A0 Vector2(coord_=
t x, coord_t y): x(x), y(y) {</div><div class=3D"subprettyprint">=C2=A0 }</=
div><div class=3D"subprettyprint">=C2=A0=C2=A0</div><div class=3D"subpretty=
print"><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>dou=
ble getLength() { // Bug - returns incorrect value</div><div class=3D"subpr=
ettyprint"><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </spa=
n>return -1;</div><div class=3D"subprettyprint"><span class=3D"Apple-tab-sp=
an" style=3D"white-space:pre"> </span>}</div><div class=3D"subprettyprint">=
=C2=A0=C2=A0</div><div class=3D"subprettyprint">=C2=A0 Vector2 getNormalise=
d() {</div><div class=3D"subprettyprint"><span class=3D"Apple-tab-span" sty=
le=3D"white-space:pre"> </span>double length =3D getLength();</div><div cl=
ass=3D"subprettyprint"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre"> </span>return Vector2(x / length, y / length);</div><div class=3D"su=
bprettyprint"><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </s=
pan>}</div><div class=3D"subprettyprint">}</div><div class=3D"subprettyprin=
t"><br></div><div class=3D"subprettyprint">class PrimaryExtendVector2: elab=
orates public Vector2 {</div><div class=3D"subprettyprint">public:</div><di=
v class=3D"subprettyprint"><span class=3D"Apple-tab-span" style=3D"white-sp=
ace:pre"> </span>double getCrossProduct(Coord other) { // Provides new func=
tionality</div><div class=3D"subprettyprint"><span class=3D"Apple-tab-span"=
style=3D"white-space:pre"> </span>return (x * other.y) - (y * other.x);</=
div><div class=3D"subprettyprint"><span class=3D"Apple-tab-span" style=3D"w=
hite-space:pre"> </span>}</div><div class=3D"subprettyprint"><br></div><div=
class=3D"subprettyprint">=C2=A0 PrimaryExtendVector2(coord_t x, coord_t y)=
: Vector2(x, y) {</div><div class=3D"subprettyprint">=C2=A0=C2=A0</div><div=
class=3D"subprettyprint">=C2=A0 }</div><div class=3D"subprettyprint">}</di=
v><div class=3D"subprettyprint"><br></div><div class=3D"subprettyprint">cla=
ss SecondaryExtendVector2: elaborates public PrimaryExtendVector2 {</div><d=
iv class=3D"subprettyprint">public:</div><div class=3D"subprettyprint"><spa=
n class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>double getLeng=
th() { // Fix bug - override=C2=A0</div><div class=3D"subprettyprint">=C2=
=A0 =C2=A0 return sqrt((x ^ 2) + (y ^ 2));</div><div class=3D"subprettyprin=
t">=C2=A0 }</div><div class=3D"subprettyprint">}</div></font></div></code><=
/div><br><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/af545d85-2927-460e-ac01-0d00f9ed0031%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/af545d85-2927-460e-ac01-0d00f9ed0031=
%40isocpp.org</a>.<br />
------=_Part_153_1027908459.1493465087068--
------=_Part_152_445475722.1493465087068--
.
Author: =?UTF-8?B?0KHRgtCw0L3QuNGB0LvQsNCyINCV0YDRiNC+0LI=?=
Date: Sun, 30 Apr 2017 20:49:04 -0700 (PDT)
Raw View
------=_Part_1409_998974767.1493610544835
Content-Type: multipart/alternative;
boundary="----=_Part_1410_831930425.1493610544836"
------=_Part_1410_831930425.1493610544836
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Nice, I miss this feature. But i think, new keyword "elaborates" is not=20
good. C++ committee don't like introduce new keywords.And how it must work=
=20
between different translation units?
=D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 29 =D0=B0=D0=BF=D1=80=D0=B5=D0=
=BB=D1=8F 2017 =D0=B3., 14:24:47 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=
=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Nom =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=
=B0=D0=BB:
>
> Hi,
> I'd like to propose a new versatile language construct for an idea. The=
=20
> premise of this is to enable a class to be enriched after it's been=20
> declared - as if you were modifying the source class directly. Think of i=
t=20
> as reversing a derived class to instead "enhance" or replace the parent=
=20
> class.
>
> This concept would be incredibly useful with reusable code bases, such as=
:
> -Game engines, where developers traditionally have to tailor source to fi=
t=20
> their own purposes. With this proposal, developers could pull in updates =
in=20
> a way which is decoupled from their own codebase, requiring one to only=
=20
> compensate for structural changes.
>
> -Incorporating 3rd-party header definitions into your project, such as a=
=20
> physics library which provided a header-defined vector class - you could=
=20
> enrich its functionality or overload it to make it play better with other=
=20
> vector types.
>
> -Creating fixes out-of-tree, you could create a patch containing code=20
> pertaining to the component affected. While this is a lesser use-case, it=
=20
> could potentially allow regression testing between old and new definition=
s=20
> and allow streamlined merging of the newer and older code bases.
> =20
> I hope we can all agree that a working implementation could potentially=
=20
> save a lot of time and cost throughout a project's lifecycle.
>
> Rules:
> -Acts almost like a derived class, except the parent itself being derived=
=20
> from all of the elaborated definitions.
> -Able to replace virtual methods - minimum requirement.
> -Able to replace public methods - ideal requirement. Detecting structural=
=20
> changes would require an explicit "override" keyword, comparable to Java'=
s.
>
> Example code:
> (Please use your imagination for more advanced use-cases)
>
> class Vector2 {
> public:
> typedef double coord_t;
> =20
> coord_t x, y;
>
> Vector2(Vector2 parent): Vector2(parent.x, parent.y) {
> }
> =20
> Vector2(coord_t x, coord_t y): x(x), y(y) {
> }
> =20
> double getLength() { // Bug - returns incorrect value
> return -1;
> }
> =20
> Vector2 getNormalised() {
> double length =3D getLength();
> return Vector2(x / length, y / length);
> }
> }
>
> class PrimaryExtendVector2: elaborates public Vector2 {
> public:
> double getCrossProduct(Coord other) { // Provides new functionality
> return (x * other.y) - (y * other.x);
> }
>
> PrimaryExtendVector2(coord_t x, coord_t y): Vector2(x, y) {
> =20
> }
> }
>
> class SecondaryExtendVector2: elaborates public PrimaryExtendVector2 {
> public:
> double getLength() { // Fix bug - override=20
> return sqrt((x ^ 2) + (y ^ 2));
> }
> }
>
>
>
--=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/28daf9c3-c357-48e8-b2d0-0401fd32314e%40isocpp.or=
g.
------=_Part_1410_831930425.1493610544836
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Nice, I miss this feature. But i think, new keyword "=
elaborates" is not good. C++ committee don't like introduce new ke=
ywords.And how it must work between different translation units?<br><br>=D1=
=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 29 =D0=B0=D0=BF=D1=80=D0=B5=D0=BB=
=D1=8F 2017 =D0=B3., 14:24:47 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=
=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Nom =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=
=D0=BB:<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>H=
i,</div><div>I'd like to propose a new versatile language construct for=
an idea. The premise of this is to enable a class to be enriched after it&=
#39;s been declared - as if you were modifying the source class directly. T=
hink of it as reversing a derived class to instead "enhance" or r=
eplace the parent class.</div><div><br></div><div>This concept would be inc=
redibly useful with reusable code bases, such as:</div><div>-Game engines, =
where developers traditionally have to tailor source to fit their own purpo=
ses. With this proposal, developers could pull in updates in a way which is=
decoupled from their own codebase, requiring one to only compensate for st=
ructural changes.</div><div><br></div><div>-Incorporating 3rd-party header =
definitions into your project, such as a physics library which provided a h=
eader-defined vector class - you could enrich its functionality or overload=
it to make it play better with other vector types.</div><div><br></div><di=
v>-Creating fixes out-of-tree, you could create a patch containing code per=
taining to the component affected. While this is a lesser use-case, it coul=
d potentially allow regression testing between old and new definitions and =
allow streamlined merging of the newer and older code bases.</div><div>=C2=
=A0</div><div>I hope we can all agree that a working implementation could p=
otentially save a lot of time and cost throughout a project's lifecycle=
..</div><div><br></div><div>Rules:</div><div>-Acts almost like a derived cla=
ss, except the parent itself being derived from all of the elaborated defin=
itions.</div><div>-Able to replace virtual methods - minimum requirement.</=
div><div>-Able to replace public methods - ideal requirement. Detecting str=
uctural changes would require an explicit "override" keyword, com=
parable to Java's.</div><div><br></div><div>Example code:</div><div>(Pl=
ease use your imagination for more advanced use-cases)</div><div><br></div>=
<div><div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,1=
87,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><di=
v><font color=3D"#660066"><div>class Vector2 {</div><div>public:</div><div>=
=C2=A0 typedef double coord_t;</div><div>=C2=A0=C2=A0</div><div>=C2=A0 coor=
d_t x, y;</div><div><br></div><div>=C2=A0 Vector2(Vector2 parent): Vector2(=
parent.x, parent.y) {</div><div>=C2=A0 }</div><div>=C2=A0=C2=A0</div><div>=
=C2=A0 Vector2(coord_t x, coord_t y): x(x), y(y) {</div><div>=C2=A0 }</div>=
<div>=C2=A0=C2=A0</div><div><span style=3D"white-space:pre"> </span>double =
getLength() { // Bug - returns incorrect value</div><div><span style=3D"whi=
te-space:pre"> </span>return -1;</div><div><span style=3D"white-space:pre"=
> </span>}</div><div>=C2=A0=C2=A0</div><div>=C2=A0 Vector2 getNormalised() =
{</div><div><span style=3D"white-space:pre"> </span>double length =3D getL=
ength();</div><div><span style=3D"white-space:pre"> </span>return Vector2(=
x / length, y / length);</div><div><span style=3D"white-space:pre"> </span>=
}</div><div>}</div><div><br></div><div>class PrimaryExtendVector2: elaborat=
es public Vector2 {</div><div>public:</div><div><span style=3D"white-space:=
pre"> </span>double getCrossProduct(Coord other) { // Provides new function=
ality</div><div><span style=3D"white-space:pre"> </span>return (x * other.=
y) - (y * other.x);</div><div><span style=3D"white-space:pre"> </span>}</di=
v><div><br></div><div>=C2=A0 PrimaryExtendVector2(coord_t x, coord_t y): Ve=
ctor2(x, y) {</div><div>=C2=A0=C2=A0</div><div>=C2=A0 }</div><div>}</div><d=
iv><br></div><div>class SecondaryExtendVector2: elaborates public PrimaryEx=
tendVector2 {</div><div>public:</div><div><span style=3D"white-space:pre"> =
</span>double getLength() { // Fix bug - override=C2=A0</div><div>=C2=A0 =
=C2=A0 return sqrt((x ^ 2) + (y ^ 2));</div><div>=C2=A0 }</div><div>}</div>=
</font></div></code></div><br><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/28daf9c3-c357-48e8-b2d0-0401fd32314e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/28daf9c3-c357-48e8-b2d0-0401fd32314e=
%40isocpp.org</a>.<br />
------=_Part_1410_831930425.1493610544836--
------=_Part_1409_998974767.1493610544835--
.
Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Sun, 30 Apr 2017 23:48:57 -0700 (PDT)
Raw View
------=_Part_553_509629088.1493621337198
Content-Type: multipart/alternative;
boundary="----=_Part_554_1068368871.1493621337198"
------=_Part_554_1068368871.1493621337198
Content-Type: text/plain; charset=UTF-8
On Saturday, April 29, 2017 at 4:24:47 AM UTC-7, Nom wrote:
>
> Hi,
> I'd like to propose a new versatile language construct for an idea. The
> premise of this is to enable a class to be enriched after it's been
> declared - as if you were modifying the source class directly. Think of it
> as reversing a derived class to instead "enhance" or replace the parent
> class.
>
Unless I'm missing something, this is another variant of the "extension
methods" or "partial classes" proposals. I'd suggest you sift through the
archives for those terms and look through the feedback they garnered.
Your particular take does have something new to discuss, though:
> Rules:
> -Acts almost like a derived class, except the parent itself being derived
> from all of the elaborated definitions.
> -Able to replace virtual methods - minimum requirement.
>
I interpret that as meaning that an elaborated type can override a virtual
function in its parent, for all users who don't also override that
function. This seems problematic. If I do this:
// a.h
struct foo { virtual void f(); };
// b.h
struct bar : elaborates foo { void f() override; };
// c.cxx
#include "a.h"
foo v1;
// d.cxx
#include "a.h"
#include "b.h"
foo v2;
Then what virtual table will v1 and v2 have? How is that resolved? Is this
a new super easy way to cause an ODR violation? What happens if I copy from
a reference to v1 into v2?
Are elaborated types' overridden methods allowed the usual covariant return
types?
-Able to replace public methods - ideal requirement. Detecting structural
> changes would require an explicit "override" keyword, comparable to Java's.
>
"Replace" as in override? Overload? Both? What are the lookup rules?
I personally would find this behavior (and the prior) vastly confusing. If
I go to the definition of Vector2 and see it has a member function
getLength that has a bug, and my code mysteriously works anyway, that's not
going to make for a good day. :) Realistically in these situations (in
games physics even!) we just patch the offending code, third-party or not.
After all, if nothing else, this feature would make me go and patch all the
third-party code that includes the header so that it also pulls in the
elaborated types and their fixes.
> Example code:
> (Please use your imagination for more advanced use-cases)
>
That's your job. :) Please provide realistic use cases as to why this
feature is worth studying. As written, your Vector2 member functions can
all be free functions and this feature is providing almost nothing of
actual value here, the above issues notwithstanding.
--
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/ad100777-2488-4b3a-b4b5-20d2fb98ed8e%40isocpp.org.
------=_Part_554_1068368871.1493621337198
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Saturday, April 29, 2017 at 4:24:47 AM UTC-7, Nom wrote=
:<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>Hi,</di=
v><div>I'd like to propose a new versatile language construct for an id=
ea. The premise of this is to enable a class to be enriched after it's =
been declared - as if you were modifying the source class directly. Think o=
f it as reversing a derived class to instead "enhance" or replace=
the parent class.</div></div></blockquote><div><br></div><div>Unless I'=
;m missing something, this is another variant of the "extension method=
s" or "partial classes" proposals. I'd suggest you sift =
through the archives for those terms and look through the feedback they gar=
nered.</div><div><br></div><div>Your particular take does have something ne=
w to discuss, though:</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>Rules:</div><div>-Acts almost like a de=
rived class, except the parent itself being derived from all of the elabora=
ted definitions.</div><div>-Able to replace virtual methods - minimum requi=
rement.</div></div></blockquote><div><br></div><div>I interpret that as mea=
ning that an elaborated type can override a virtual function in its parent,=
for all users who don't also override that function. This seems proble=
matic. If I do this:</div><div><blockquote style=3D"margin: 0 0 0 40px; bor=
der: none; padding: 0px;"><div><br></div><div>// a.h</div><div>struct foo {=
virtual void f(); };</div><div><br></div><div>// b.h</div><div>struct bar =
: elaborates foo { void f() override; };</div><div><br></div><div>// c.cxx<=
/div><div>#include "a.h"</div><div>foo v1;</div><div><br></div><d=
iv>// d.cxx</div><div>#include "a.h"</div><div>#include "b.h=
"</div><div>foo v2;</div></blockquote></div><div>=C2=A0</div><div>Then=
what virtual table will v1 and v2 have? How is that resolved? Is this a ne=
w super easy way to cause an ODR violation? What happens if I copy from a r=
eference to v1 into v2?</div><div><br></div><div>Are elaborated types' =
overridden methods allowed the usual covariant return types?</div><div><br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8=
ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>-A=
ble to replace public methods - ideal requirement. Detecting structural cha=
nges would require an explicit "override" keyword, comparable to =
Java's.</div></div></blockquote><div><br></div><div>"Replace"=
as in override? Overload? Both? What are the lookup rules?</div><div>=C2=
=A0</div><div>I personally would find this behavior (and the prior) vastly =
confusing. If I go to the definition of Vector2 and see it has a member fun=
ction getLength that has a bug, and my code mysteriously works anyway, that=
's not going to make for a good day. :) Realistically in these situatio=
ns (in games physics even!) we just patch the offending code, third-party o=
r not. After all, if nothing else, this feature would make me go and patch =
all the third-party code that includes the header so that it also pulls in =
the elaborated types and their fixes.</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><br></div><div>Example co=
de:</div><div>(Please use your imagination for more advanced use-cases)</di=
v></div></blockquote><div><br></div><div>That's your job. :) Please pro=
vide realistic use cases as to why this feature is worth studying. As writt=
en, your Vector2 member functions can all be free functions and this featur=
e is providing almost nothing of actual value here, the above issues notwit=
hstanding.</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/ad100777-2488-4b3a-b4b5-20d2fb98ed8e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ad100777-2488-4b3a-b4b5-20d2fb98ed8e=
%40isocpp.org</a>.<br />
------=_Part_554_1068368871.1493621337198--
------=_Part_553_509629088.1493621337198--
.
Author: Nom <turbine1991@gmail.com>
Date: Sun, 30 Apr 2017 23:58:59 -0700 (PDT)
Raw View
------=_Part_2132_1641959898.1493621939757
Content-Type: multipart/alternative;
boundary="----=_Part_2133_720235864.1493621939758"
------=_Part_2133_720235864.1493621939758
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Regarding translation units. This idea is intended to replace instead of=20
allowing backwards invocation, wouldn't it be possible to just make it=20
append and replace all of the subsequent definitions to the original fine=
=20
before parsing it? That'd be the simplest implementation I can think of.
On Monday, 1 May 2017 15:49:05 UTC+12, Stanislav Ershov wrote:
>
> Nice, I miss this feature. But i think, new keyword "elaborates" is not=
=20
> good. C++ committee don't like introduce new keywords.And how it must wor=
k=20
> between different translation units?
>
> =D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 29 =D0=B0=D0=BF=D1=80=D0=B5=
=D0=BB=D1=8F 2017 =D0=B3., 14:24:47 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=
=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Nom =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=
=D0=B0=D0=BB:
>>
>> Hi,
>> I'd like to propose a new versatile language construct for an idea. The=
=20
>> premise of this is to enable a class to be enriched after it's been=20
>> declared - as if you were modifying the source class directly. Think of =
it=20
>> as reversing a derived class to instead "enhance" or replace the parent=
=20
>> class.
>>
>> This concept would be incredibly useful with reusable code bases, such a=
s:
>> -Game engines, where developers traditionally have to tailor source to=
=20
>> fit their own purposes. With this proposal, developers could pull in=20
>> updates in a way which is decoupled from their own codebase, requiring o=
ne=20
>> to only compensate for structural changes.
>>
>> -Incorporating 3rd-party header definitions into your project, such as a=
=20
>> physics library which provided a header-defined vector class - you could=
=20
>> enrich its functionality or overload it to make it play better with othe=
r=20
>> vector types.
>>
>> -Creating fixes out-of-tree, you could create a patch containing code=20
>> pertaining to the component affected. While this is a lesser use-case, i=
t=20
>> could potentially allow regression testing between old and new definitio=
ns=20
>> and allow streamlined merging of the newer and older code bases.
>> =20
>> I hope we can all agree that a working implementation could potentially=
=20
>> save a lot of time and cost throughout a project's lifecycle.
>>
>> Rules:
>> -Acts almost like a derived class, except the parent itself being derive=
d=20
>> from all of the elaborated definitions.
>> -Able to replace virtual methods - minimum requirement.
>> -Able to replace public methods - ideal requirement. Detecting structura=
l=20
>> changes would require an explicit "override" keyword, comparable to Java=
's.
>>
>> Example code:
>> (Please use your imagination for more advanced use-cases)
>>
>> class Vector2 {
>> public:
>> typedef double coord_t;
>> =20
>> coord_t x, y;
>>
>> Vector2(Vector2 parent): Vector2(parent.x, parent.y) {
>> }
>> =20
>> Vector2(coord_t x, coord_t y): x(x), y(y) {
>> }
>> =20
>> double getLength() { // Bug - returns incorrect value
>> return -1;
>> }
>> =20
>> Vector2 getNormalised() {
>> double length =3D getLength();
>> return Vector2(x / length, y / length);
>> }
>> }
>>
>> class PrimaryExtendVector2: elaborates public Vector2 {
>> public:
>> double getCrossProduct(Coord other) { // Provides new functionality
>> return (x * other.y) - (y * other.x);
>> }
>>
>> PrimaryExtendVector2(coord_t x, coord_t y): Vector2(x, y) {
>> =20
>> }
>> }
>>
>> class SecondaryExtendVector2: elaborates public PrimaryExtendVector2 {
>> public:
>> double getLength() { // Fix bug - override=20
>> return sqrt((x ^ 2) + (y ^ 2));
>> }
>> }
>>
>>
>>
--=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/26c3156b-7b04-406e-aaba-cc3c295cd839%40isocpp.or=
g.
------=_Part_2133_720235864.1493621939758
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Regarding translation units. This idea is intended to repl=
ace instead of allowing backwards invocation, wouldn't it be possible t=
o just make it append and replace all of the subsequent definitions to the =
original fine before parsing it? That'd be the simplest implementation =
I can think of.<div><br>On Monday, 1 May 2017 15:49:05 UTC+12, Stanislav Er=
shov 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">N=
ice, I miss this feature. But i think, new keyword "elaborates" i=
s not good. C++ committee don't like introduce new keywords.And how it =
must work between different translation units?<br><br>=D1=81=D1=83=D0=B1=D0=
=B1=D0=BE=D1=82=D0=B0, 29 =D0=B0=D0=BF=D1=80=D0=B5=D0=BB=D1=8F 2017 =D0=B3.=
, 14:24:47 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=
=B5=D0=BB=D1=8C Nom =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<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>Hi,</div><div>I'd lik=
e to propose a new versatile language construct for an idea. The premise of=
this is to enable a class to be enriched after it's been declared - as=
if you were modifying the source class directly. Think of it as reversing =
a derived class to instead "enhance" or replace the parent class.=
</div><div><br></div><div>This concept would be incredibly useful with reus=
able code bases, such as:</div><div>-Game engines, where developers traditi=
onally have to tailor source to fit their own purposes. With this proposal,=
developers could pull in updates in a way which is decoupled from their ow=
n codebase, requiring one to only compensate for structural changes.</div><=
div><br></div><div>-Incorporating 3rd-party header definitions into your pr=
oject, such as a physics library which provided a header-defined vector cla=
ss - you could enrich its functionality or overload it to make it play bett=
er with other vector types.</div><div><br></div><div>-Creating fixes out-of=
-tree, you could create a patch containing code pertaining to the component=
affected. While this is a lesser use-case, it could potentially allow regr=
ession testing between old and new definitions and allow streamlined mergin=
g of the newer and older code bases.</div><div>=C2=A0</div><div>I hope we c=
an all agree that a working implementation could potentially save a lot of =
time and cost throughout a project's lifecycle.</div><div><br></div><di=
v>Rules:</div><div>-Acts almost like a derived class, except the parent its=
elf being derived from all of the elaborated definitions.</div><div>-Able t=
o replace virtual methods - minimum requirement.</div><div>-Able to replace=
public methods - ideal requirement. Detecting structural changes would req=
uire an explicit "override" keyword, comparable to Java's.</d=
iv><div><br></div><div>Example code:</div><div>(Please use your imagination=
for more advanced use-cases)</div><div><br></div><div><div style=3D"backgr=
ound-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:soli=
d;border-width:1px;word-wrap:break-word"><code><div><font color=3D"#660066"=
><div>class Vector2 {</div><div>public:</div><div>=C2=A0 typedef double coo=
rd_t;</div><div>=C2=A0=C2=A0</div><div>=C2=A0 coord_t x, y;</div><div><br><=
/div><div>=C2=A0 Vector2(Vector2 parent): Vector2(parent.x, parent.y) {</di=
v><div>=C2=A0 }</div><div>=C2=A0=C2=A0</div><div>=C2=A0 Vector2(coord_t x, =
coord_t y): x(x), y(y) {</div><div>=C2=A0 }</div><div>=C2=A0=C2=A0</div><di=
v><span style=3D"white-space:pre"> </span>double getLength() { // Bug - ret=
urns incorrect value</div><div><span style=3D"white-space:pre"> </span>ret=
urn -1;</div><div><span style=3D"white-space:pre"> </span>}</div><div>=C2=
=A0=C2=A0</div><div>=C2=A0 Vector2 getNormalised() {</div><div><span style=
=3D"white-space:pre"> </span>double length =3D getLength();</div><div><spa=
n style=3D"white-space:pre"> </span>return Vector2(x / length, y / length)=
;</div><div><span style=3D"white-space:pre"> </span>}</div><div>}</div><div=
><br></div><div>class PrimaryExtendVector2: elaborates public Vector2 {</di=
v><div>public:</div><div><span style=3D"white-space:pre"> </span>double get=
CrossProduct(Coord other) { // Provides new functionality</div><div><span s=
tyle=3D"white-space:pre"> </span>return (x * other.y) - (y * other.x);</di=
v><div><span style=3D"white-space:pre"> </span>}</div><div><br></div><div>=
=C2=A0 PrimaryExtendVector2(coord_t x, coord_t y): Vector2(x, y) {</div><di=
v>=C2=A0=C2=A0</div><div>=C2=A0 }</div><div>}</div><div><br></div><div>clas=
s SecondaryExtendVector2: elaborates public PrimaryExtendVector2 {</div><di=
v>public:</div><div><span style=3D"white-space:pre"> </span>double getLengt=
h() { // Fix bug - override=C2=A0</div><div>=C2=A0 =C2=A0 return sqrt((x ^ =
2) + (y ^ 2));</div><div>=C2=A0 }</div><div>}</div></font></div></code></di=
v><br><br></div></div></blockquote></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" 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/26c3156b-7b04-406e-aaba-cc3c295cd839%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/26c3156b-7b04-406e-aaba-cc3c295cd839=
%40isocpp.org</a>.<br />
------=_Part_2133_720235864.1493621939758--
------=_Part_2132_1641959898.1493621939757--
.
Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Mon, 1 May 2017 12:05:01 -0700 (PDT)
Raw View
------=_Part_282_972533814.1493665501258
Content-Type: multipart/alternative;
boundary="----=_Part_283_853216581.1493665501258"
------=_Part_283_853216581.1493665501258
Content-Type: text/plain; charset=UTF-8
On Sunday, April 30, 2017 at 11:58:59 PM UTC-7, Nom wrote:
>
> Regarding translation units. This idea is intended to replace instead of
> allowing backwards invocation, wouldn't it be possible to just make it
> append and replace all of the subsequent definitions to the original fine
> before parsing it? That'd be the simplest implementation I can think of.
>
Can you rephrase that in standard C++ terminology? I have literally no idea
what you mean by "replace" or "backwards invocation" or whatnot.
--
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/cace89b9-fc31-47ae-a49a-d99d7a911ec1%40isocpp.org.
------=_Part_283_853216581.1493665501258
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Sunday, April 30, 2017 at 11:58:59 PM UTC-7, Nom wrote:=
<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">Regarding tra=
nslation units. This idea is intended to replace instead of allowing backwa=
rds invocation, wouldn't it be possible to just make it append and repl=
ace all of the subsequent definitions to the original fine before parsing i=
t? That'd be the simplest implementation I can think of.</div></blockqu=
ote><div><br></div><div>Can you rephrase that in standard C++ terminology? =
I have literally no idea what you mean by "replace" or "back=
wards invocation" or whatnot.</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/cace89b9-fc31-47ae-a49a-d99d7a911ec1%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/cace89b9-fc31-47ae-a49a-d99d7a911ec1=
%40isocpp.org</a>.<br />
------=_Part_283_853216581.1493665501258--
------=_Part_282_972533814.1493665501258--
.
Author: Nom <turbine1991@gmail.com>
Date: Mon, 1 May 2017 19:34:54 -0700 (PDT)
Raw View
------=_Part_2396_538373597.1493692494845
Content-Type: multipart/alternative;
boundary="----=_Part_2397_233825465.1493692494845"
------=_Part_2397_233825465.1493692494845
Content-Type: text/plain; charset=UTF-8
On Tuesday, 2 May 2017 07:05:01 UTC+12, Sean Middleditch wrote:
>
> On Sunday, April 30, 2017 at 11:58:59 PM UTC-7, Nom wrote:
>>
>> Regarding translation units. This idea is intended to replace instead of
>> allowing backwards invocation, wouldn't it be possible to just make it
>> append and replace all of the subsequent definitions to the original fine
>> before parsing it? That'd be the simplest implementation I can think of.
>>
>
> Can you rephrase that in standard C++ terminology? I have literally no
> idea what you mean by "replace" or "backwards invocation" or whatnot.
>
When you have a virtual function, you can replace or override it with a
derived class. A derived class may invoke its parents functions explicitly.
No need to be rude.
--
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/e2c379c7-95e1-4133-924d-3de30884918e%40isocpp.org.
------=_Part_2397_233825465.1493692494845
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>On Tuesday, 2 May 2017 07:05:01 UTC+12, Sean Middledit=
ch 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, April 30, 2017 at 11:58:59 PM UTC-7, Nom wrote:<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">Regarding translation units. This idea=
is intended to replace instead of allowing backwards invocation, wouldn=
9;t it be possible to just make it append and replace all of the subsequent=
definitions to the original fine before parsing it? That'd be the simp=
lest implementation I can think of.</div></blockquote><div><br></div><div>C=
an you rephrase that in standard C++ terminology? I have literally no idea =
what you mean by "replace" or "backwards invocation" or=
whatnot.</div></div></blockquote><div><br></div><div>When you have a virtu=
al function, you can replace or override it with a derived class. A derived=
class may invoke its parents functions explicitly. No need to be rude.</di=
v></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/e2c379c7-95e1-4133-924d-3de30884918e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e2c379c7-95e1-4133-924d-3de30884918e=
%40isocpp.org</a>.<br />
------=_Part_2397_233825465.1493692494845--
------=_Part_2396_538373597.1493692494845--
.
Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Mon, 1 May 2017 22:51:56 -0700
Raw View
--001a114c84a03b4080054e8423ee
Content-Type: text/plain; charset=UTF-8
On May 1, 2017 7:34 PM, "Nom" <turbine1991@gmail.com> wrote:
On Tuesday, 2 May 2017 07:05:01 UTC+12, Sean Middleditch wrote:
>
> On Sunday, April 30, 2017 at 11:58:59 PM UTC-7, Nom wrote:
>>
>> Regarding translation units. This idea is intended to replace instead of
>> allowing backwards invocation, wouldn't it be possible to just make it
>> append and replace all of the subsequent definitions to the original fine
>> before parsing it? That'd be the simplest implementation I can think of.
>>
>
> Can you rephrase that in standard C++ terminology? I have literally no
> idea what you mean by "replace" or "backwards invocation" or whatnot.
>
When you have a virtual function, you can replace or override it with a
derived class. A derived class may invoke its parents functions explicitly.
No need to be rude.
I'm not trying to be rude; I really had no idea what you were referring to.
Using the standard's correct terminology would avoid that confusion. :)
In any case, I'm still unclear what your response means in contest of the
original question: how does an elaborated class impact a parent when the
compiler only knows about the elaborated class in a subset of TUs? Does it
involve UB or new mangling rules? Does it affect type equality? Did
declaration order matter? What if two elaborated classes override the same
member?
Expanding on real use cases may help guide the answers.
--
You received this message because you are subscribed to a topic in the
Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this topic, visit https://groups.google.com/a/
isocpp.org/d/topic/std-proposals/dD44nekLF0U/unsubscribe.
To unsubscribe from this group and all its topics, 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/e2c379c7-95e1-4133-
924d-3de30884918e%40isocpp.org
<https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/e2c379c7-95e1-4133-924d-3de30884918e%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/CALQmNFhW3zMXSBdLvkg3NWFbUEO%2BmQEwjdmfmB0h1inBQDy1-g%40mail.gmail.com.
--001a114c84a03b4080054e8423ee
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><div><div class=3D"gmail_extra"><div class=3D"gmail_quote=
">On May 1, 2017 7:34 PM, "Nom" <<a href=3D"mailto:turbine1991=
@gmail.com">turbine1991@gmail.com</a>> wrote:<br type=3D"attribution"><b=
lockquote class=3D"quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"quoted-text"><br>On T=
uesday, 2 May 2017 07:05:01 UTC+12, Sean Middleditch wrote:<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">On Sunday, April 30, 2017 at 11:5=
8:59 PM UTC-7, Nom 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">Regarding translation units. This idea is intended to replace inst=
ead of allowing backwards invocation, wouldn't it be possible to just m=
ake it append and replace all of the subsequent definitions to the original=
fine before parsing it? That'd be the simplest implementation I can th=
ink of.</div></blockquote><div><br></div><div>Can you rephrase that in stan=
dard C++ terminology? I have literally no idea what you mean by "repla=
ce" or "backwards invocation" or whatnot.</div></div></block=
quote><div><br></div></div><div>When you have a virtual function, you can r=
eplace or override it with a derived class. A derived class may invoke its =
parents functions explicitly. No need to be rude.</div></div></blockquote><=
/div></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">I'm not =
trying to be rude; I really had no idea what you were referring to. Using t=
he standard's correct terminology would avoid that confusion. :)</div><=
div dir=3D"auto"><br></div><div dir=3D"auto">In any case, I'm still unc=
lear what your response means in contest of the original question: how does=
an elaborated class impact a parent when the compiler only knows about the=
elaborated class in a subset of TUs? Does it involve UB or new mangling ru=
les? Does it affect type equality? Did declaration order matter? What if tw=
o elaborated classes override the same member?</div><div dir=3D"auto"><br><=
/div><div dir=3D"auto">Expanding on real use cases may help guide the answe=
rs.</div><div dir=3D"auto"><div class=3D"gmail_extra"><div class=3D"gmail_q=
uote"><blockquote class=3D"quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"quoted-text">
<p></p>
-- <br>
You received this message because you are subscribed to a topic in the Goog=
le Groups "ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
a/isocpp.org/d/topic/std-proposals/dD44nekLF0U/unsubscribe" target=3D"_blan=
k">https://groups.google.com/a/<wbr>isocpp.org/d/topic/std-<wbr>proposals/d=
D44nekLF0U/<wbr>unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href=
=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-prop=
osals+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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/e2c379c7-95e1-4133-924d-3de30884918e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/e2c3=
79c7-95e1-4133-<wbr>924d-3de30884918e%40isocpp.org</a><wbr>.<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/CALQmNFhW3zMXSBdLvkg3NWFbUEO%2BmQEwjd=
mfmB0h1inBQDy1-g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALQmNFhW3zMXSB=
dLvkg3NWFbUEO%2BmQEwjdmfmB0h1inBQDy1-g%40mail.gmail.com</a>.<br />
--001a114c84a03b4080054e8423ee--
.