Topic: Reusing a class (or primitive type) with


Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Mon, 25 Sep 2017 10:55:05 -0400
Raw View
--089e0820b4e0b5036c055a04bf00
Content-Type: text/plain; charset="UTF-8"

On Sun, Sep 24, 2017 at 4:57 PM, Nicol Bolas <jmckesson@gmail.com> wrote:
>
> The problem is the intersection of two facts:
> 1: In C++, non-member functions play a vital role in defining a class's
> interface.
> 2: C++ does not have a way to explicitly associate a non-member function
> as being part of a class's interface.
> This makes it impossible to distinguish between arbitrary non-members that
> happen to take the function as a parameter, and non-members that genuinely
> are part of the type's interface.
>

Naturally, Ada got this right decades ago: <
http://www.adaic.org/resources/add_content/standards/12rm/html/RM-3-4.html>.
Types are defined in packages. The "primitive subprograms" of a type are
defined in the package.  Derived types inherit the primitive subprograms,
modified to take the new type.

--
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/CAHSYqdYTNFvJv6yz9y1zPd3K3Y1ep9ihpi70tbsuf3xnkWvXCw%40mail.gmail.com.

--089e0820b4e0b5036c055a04bf00
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On S=
un, Sep 24, 2017 at 4:57 PM, Nicol Bolas <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:jmckesson@gmail.com" target=3D"_blank">jmckesson@gmail.com</a>&gt;</s=
pan> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"lt=
r"><div>The problem is the intersection of two facts:</div><div>1: In C++, =
non-member functions play a vital role in defining a class&#39;s interface.=
</div><div>2: C++ does not have a way to explicitly associate a non-member =
function as being part of a class&#39;s interface.</div><div>This makes it =
impossible to distinguish between arbitrary non-members that happen to take=
 the function as a parameter, and non-members that genuinely are part of th=
e type&#39;s interface.</div></div></blockquote><div><br>Naturally, Ada got=
 this right decades ago: &lt;<a href=3D"http://www.adaic.org/resources/add_=
content/standards/12rm/html/RM-3-4.html">http://www.adaic.org/resources/add=
_content/standards/12rm/html/RM-3-4.html</a>&gt;.<br>Types are defined in p=
ackages. The &quot;primitive subprograms&quot; of a type are defined in the=
 package.=C2=A0 Derived types inherit the primitive subprograms, modified t=
o take the new type.</div></div></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&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/CAHSYqdYTNFvJv6yz9y1zPd3K3Y1ep9ihpi70=
tbsuf3xnkWvXCw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYTNFvJv6yz=
9y1zPd3K3Y1ep9ihpi70tbsuf3xnkWvXCw%40mail.gmail.com</a>.<br />

--089e0820b4e0b5036c055a04bf00--

.