Topic: C++ interface "support
Author: matekm@gmail.com
Date: Sat, 15 Nov 2014 14:52:48 -0800 (PST)
Raw View
------=_Part_416_1297007209.1416091968618
Content-Type: text/plain; charset=UTF-8
Hi,
What I lack in C++ is 'interface' keyword that would enforce some common
constrains for the class. I mean, when user define a class with an
'interface' keyword instead of 'class', then following checks would be
performed:
* is destructor virtual? If no - then error,
* are all methods pure virtual? If no - error.
Those are two requirements that are important to me, but I think that
allowing for constexpr/static const variables in interaface definition
would be also ok.
What do you think about that idea?
Br,
Robert Matusewicz
--
---
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_416_1297007209.1416091968618
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><span style=3D"font-family: arial; font-size: small;">Hi,<=
/span><div style=3D"font-family: arial; font-size: small;"><br></div><div s=
tyle=3D"font-family: arial; font-size: small;">What I lack in C++ is 'inter=
face' keyword that would enforce some common constrains for the class. I me=
an, when user define a class with an 'interface' keyword instead of '=
class', then following checks would be performed:</div><div style=3D"font-f=
amily: arial; font-size: small;">* is destructor virtual? If no - then erro=
r,</div><div style=3D"font-family: arial; font-size: small;">* are all meth=
ods pure virtual? If no - error.</div><div style=3D"font-family: arial; fon=
t-size: small;"><br></div><div style=3D"font-family: arial; font-size: smal=
l;">Those are two requirements that are important to me, but I think that a=
llowing for constexpr/static const variables in interaface definition would=
be also ok.</div><div style=3D"font-family: arial; font-size: small;"><br>=
</div><div style=3D"font-family: arial; font-size: small;">What do you thin=
k about that idea?</div><div style=3D"font-family: arial; font-size: small;=
"><br></div><div style=3D"font-family: arial; font-size: small;">Br,</div><=
div style=3D"font-family: arial; font-size: small;">Robert Matusewicz</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_416_1297007209.1416091968618--
.
Author: "Francis (Grizzly) Smit" <grizzlysmit@gmail.com>
Date: Sun, 16 Nov 2014 13:50:10 +1100
Raw View
This is a multi-part message in MIME format.
--------------090903090204070708060301
Content-Type: text/plain; charset=UTF-8; format=flowed
On 16/11/14 09:52, matekm@gmail.com wrote:
> Hi,
>
> What I lack in C++ is 'interface' keyword that would enforce some
> common constrains for the class. I mean, when user define a class with
> an 'interface' keyword instead of 'class', then following checks
> would be performed:
> * is destructor virtual? If no - then error,
> * are all methods pure virtual? If no - error.
>
> Those are two requirements that are important to me, but I think that
> allowing for constexpr/static const variables in interaface definition
> would be also ok.
>
> What do you think about that idea?
>
I have yet to see what interfaces can do that a pure virtual or abstract
class cannot.
> Br,
> Robert Matusewicz
> --
>
> ---
> 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
> <mailto:std-proposals+unsubscribe@isocpp.org>.
> To post to this group, send email to std-proposals@isocpp.org
> <mailto:std-proposals@isocpp.org>.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
--
.~. In my life God comes first....
/V\ but Linux is pretty high after that :-D
/( )\ Francis (Grizzly) Smit
^^-^^ http://www.smit.id.au/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GM/CS/H/P/S/IT/L d- s+:+ a++ C++++ UL++++$ P++ L+++$ E--- W++
N W--- M-- V-- PE- PGP t+ 5-- X-- R- tv b++++ D-
G e++ h+ y?
------END GEEK CODE BLOCK------
http://www.geekcode.com/
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--------------090903090204070708060301
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">
<br>
<div class=3D"moz-cite-prefix">On 16/11/14 09:52, <a class=3D"moz-txt-l=
ink-abbreviated" href=3D"mailto:matekm@gmail.com">matekm@gmail.com</a>
wrote:<br>
</div>
<blockquote
cite=3D"mid:c683da04-70f2-456f-b97a-bd8529f6c88f@isocpp.org"
type=3D"cite">
<div dir=3D"ltr"><span style=3D"font-family: arial; font-size: small;=
">Hi,</span>
<div style=3D"font-family: arial; font-size: small;"><br>
</div>
<div style=3D"font-family: arial; font-size: small;">What I lack
in C++ is 'interface' keyword that would enforce some common
constrains for the class. I mean, when user define a class
with an 'interface' keyword =C2=A0instead of 'class', then
following checks would be performed:</div>
<div style=3D"font-family: arial; font-size: small;">* is
destructor virtual? If no - then error,</div>
<div style=3D"font-family: arial; font-size: small;">* are all
methods pure virtual? If no - error.</div>
<div style=3D"font-family: arial; font-size: small;"><br>
</div>
<div style=3D"font-family: arial; font-size: small;">Those are two
requirements that are important to me, but I think that
allowing for constexpr/static const variables in interaface
definition would be also ok.</div>
<div style=3D"font-family: arial; font-size: small;"><br>
</div>
<div style=3D"font-family: arial; font-size: small;">What do you
think about that idea?</div>
<div style=3D"font-family: arial; font-size: small;"><br>
</div>
</div>
</blockquote>
<br>
I have yet to see what interfaces can do that a pure virtual or
abstract class cannot. =C2=A0 <br>
<br>
<br>
<br>
<blockquote
cite=3D"mid:c683da04-70f2-456f-b97a-bd8529f6c88f@isocpp.org"
type=3D"cite">
<div dir=3D"ltr">
<div style=3D"font-family: arial; font-size: small;">Br,</div>
<div style=3D"font-family: arial; font-size: small;">Robert
Matusewicz</div>
</div>
-- <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 moz-do-not-send=3D"true"
href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+=
unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a moz-do-not-send=3D"true"
href=3D"mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</=
a>.<br>
Visit this group at <a moz-do-not-send=3D"true"
href=3D"http://groups.google.com/a/isocpp.org/group/std-proposals/"=
>http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br>
</blockquote>
<br>
<div class=3D"moz-signature">-- <br>
<pre> .~. In my life God comes first....
/V\ but Linux is pretty high after that :-D
/( )\ Francis (Grizzly) Smit
^^-^^ <a class=3D"moz-txt-link-freetext" href=3D"http://www.smit.id.au=
/">http://www.smit.id.au/</a>
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GM/CS/H/P/S/IT/L d- s+:+ a++ C++++ UL++++$ P++ L+++$ E--- W++
N W--- M-- V-- PE- PGP t+ 5-- X-- R- tv b++++ D-
G e++ h+ y?
------END GEEK CODE BLOCK------
<a class=3D"moz-txt-link-freetext" href=3D"http://www.geekcode.com/">http:/=
/www.geekcode.com/</a>
</pre>
</div>
</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 />
--------------090903090204070708060301--
.
Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Sat, 15 Nov 2014 22:51:32 -0800 (PST)
Raw View
------=_Part_65_2112260073.1416120692935
Content-Type: multipart/alternative;
boundary="----=_Part_66_702878354.1416120692935"
------=_Part_66_702878354.1416120692935
Content-Type: text/plain; charset=UTF-8
On Saturday, November 15, 2014 6:50:17 PM UTC-8, Francis Grizzly Smit wrote:
>
> I have yet to see what interfaces can do that a pure virtual or abstract
> class cannot.
>
His point was only that it would enforce certain rules for the pure virtual
class, not that it'd be some separate thing. Still not sure it's necessary
or all that useful at all.
--
---
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_66_702878354.1416120692935
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Saturday, November 15, 2014 6:50:17 PM UTC-8, Francis G=
rizzly Smit wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">I have yet to see what interfac=
es can do that a pure virtual or
abstract class cannot.<br></div></blockquote><div> </div><div>His =
point was only that it would enforce certain rules for the pure virtual cla=
ss, not that it'd be some separate thing. Still not sure it's necessary or =
all that useful at all.</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_66_702878354.1416120692935--
------=_Part_65_2112260073.1416120692935--
.
Author: "Daniel Gutson" <danielgutson@gmail.com>
Date: Mon, 17 Nov 2014 00:21:08 +0000
Raw View
--part1622-boundary-2084977418-934478842
Content-Type: text/plain; charset=UTF-8
FWIW, I asked Bjarne about this in Rapperswil. He referred to his "famous time machine", in the sense that this should have been defined 15 years ago.
-----Original Message-----
From: Sean Middleditch <sean.middleditch@gmail.com>
Date: Sat, 15 Nov 2014 22:51:32
To: <std-proposals@isocpp.org>
Reply-To: std-proposals@isocpp.org
Subject: Re: [std-proposals] C++ interface "support"
On Saturday, November 15, 2014 6:50:17 PM UTC-8, Francis Grizzly Smit wrote:
>
> I have yet to see what interfaces can do that a pure virtual or abstract
> class cannot.
>
His point was only that it would enforce certain rules for the pure virtual
class, not that it'd be some separate thing. Still not sure it's necessary
or all that useful at all.
--
---
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/.
--
---
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/.
--part1622-boundary-2084977418-934478842
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><=
meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type"></h=
ead><body>FWIW, I asked Bjarne about this in Rapperswil. He referred to his=
"famous time machine", in the sense that this should have been defined 15 =
years ago. <hr/><div><b>From: </b> Sean Middleditch <sean.middleditch@gm=
ail.com>
</div><div><b>Date: </b>Sat, 15 Nov 2014 22:51:32 -0800 (PST)</div><div><b>=
To: </b><std-proposals@isocpp.org></div><div><b>ReplyTo: </b> std-pro=
posals@isocpp.org
</div><div><b>Subject: </b>Re: [std-proposals] C++ interface "support"</div=
><div><br/></div><div dir=3D"ltr">On Saturday, November 15, 2014 6:50:17 PM=
UTC-8, Francis Grizzly Smit wrote:<blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">I have yet to see what interfac=
es can do that a pure virtual or
abstract class cannot.<br></div></blockquote><div> </div><div>His =
point was only that it would enforce certain rules for the pure virtual cla=
ss, not that it'd be some separate thing. Still not sure it's necessary or =
all that useful at all.</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 />
</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 />
--part1622-boundary-2084977418-934478842--
.
Author: Robert Matusewicz <matekm@gmail.com>
Date: Tue, 18 Nov 2014 08:50:14 +0100
Raw View
--047d7bdc05e89dd15e05081d5947
Content-Type: text/plain; charset=UTF-8
Hi,
2014-11-17 1:21 GMT+01:00 Daniel Gutson <danielgutson@gmail.com>:
> FWIW, I asked Bjarne about this in Rapperswil. He referred to his "famous
> time machine", in the sense that this should have been defined 15 years ago.
>
Well, such addition would be very usefull in enviorment where I'm working,
but from what I see, it looks like most ppl think this isn't important.
Br,
Robert
> ------------------------------
> *From: * Sean Middleditch <sean.middleditch@gmail.com>
> *Date: *Sat, 15 Nov 2014 22:51:32 -0800 (PST)
> *To: *<std-proposals@isocpp.org>
> *ReplyTo: * std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] C++ interface "support"
>
> On Saturday, November 15, 2014 6:50:17 PM UTC-8, Francis Grizzly Smit
> wrote:
>>
>> I have yet to see what interfaces can do that a pure virtual or abstract
>> class cannot.
>>
>
> His point was only that it would enforce certain rules for the pure
> virtual class, not that it'd be some separate thing. Still not sure it's
> necessary or all that useful at all.
>
> --
>
> ---
> 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/.
>
> --
>
> ---
> 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/dlShQZJ2gl8/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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
--
My public key can be found at https://keyserver2.pgp.com
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--047d7bdc05e89dd15e05081d5947
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi,<br><div class=3D"gmail_extra"><br><div class=3D"gmail_=
quote">2014-11-17 1:21 GMT+01:00 Daniel Gutson <span dir=3D"ltr"><<a hre=
f=3D"mailto:danielgutson@gmail.com" target=3D"_blank">danielgutson@gmail.co=
m</a>></span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 =
0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u><div>FWIW, I ask=
ed Bjarne about this in Rapperswil. He referred to his "famous time ma=
chine", in the sense that this should have been defined 15 years ago.<=
/div></blockquote><div><br></div><div>Well, such addition would be very use=
full in enviorment where I'm working, but from what I see, it looks lik=
e most ppl think this isn't important.</div><div><br></div><div>Br,</di=
v><div>Robert</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
..8ex;border-left:1px #ccc solid;padding-left:1ex"><div> <hr><div><b>From: <=
/b> Sean Middleditch <<a href=3D"mailto:sean.middleditch@gmail.com" targ=
et=3D"_blank">sean.middleditch@gmail.com</a>>
</div><div><b>Date: </b>Sat, 15 Nov 2014 22:51:32 -0800 (PST)</div><div><b>=
To: </b><<a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">s=
td-proposals@isocpp.org</a>></div><div><b>ReplyTo: </b> <a href=3D"mailt=
o:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>
</div><div><b>Subject: </b>Re: [std-proposals] C++ interface "support&=
quot;</div><span class=3D""><div><br></div><div dir=3D"ltr">On Saturday, No=
vember 15, 2014 6:50:17 PM UTC-8, Francis Grizzly Smit wrote:<blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #cc=
c solid;padding-left:1ex">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">I have yet to see what interfac=
es can do that a pure virtual or
abstract class cannot.<br></div></blockquote><div>=C2=A0</div><div>His =
point was only that it would enforce certain rules for the pure virtual cla=
ss, not that it'd be some separate thing. Still not sure it's neces=
sary or all that useful at all.</div></div>
<p></p>
-- <br>
<br>
--- <br></span><span class=3D"">
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br></span>
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>.<span class=3D""><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>
</span></div><div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
-- <br>
<br>
--- <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/dlShQZJ2gl8/unsubscribe" target=3D"_blan=
k">https://groups.google.com/a/isocpp.org/d/topic/std-proposals/dlShQZJ2gl8=
/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@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><br clear=3D"all"><div><br></div>-- <br>=
<div class=3D"gmail_signature">My public key can be found at <a href=3D"htt=
ps://keyserver2.pgp.com">https://keyserver2.pgp.com</a></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">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 />
--047d7bdc05e89dd15e05081d5947--
.
Author: "'Jeffrey Yasskin' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 17 Nov 2014 23:58:37 -0800
Raw View
--bcaec548a13da5206905081d7774
Content-Type: text/plain; charset=UTF-8
This is the sort of thing that could be achieved with an attribute and a
compiler warning flag. Since I don't know of any compilers with that
option, it doesn't look that important to add to the standard. However, if
you can convince your compiler's implementer to add it, and folks wind up
liking it, that would be a good argument for standardization.
On Sat, Nov 15, 2014 at 2:52 PM, <matekm@gmail.com> wrote:
> Hi,
>
> What I lack in C++ is 'interface' keyword that would enforce some common
> constrains for the class. I mean, when user define a class with an
> 'interface' keyword instead of 'class', then following checks would be
> performed:
> * is destructor virtual? If no - then error,
> * are all methods pure virtual? If no - error.
>
> Those are two requirements that are important to me, but I think that
> allowing for constexpr/static const variables in interaface definition
> would be also ok.
>
> What do you think about that idea?
>
> Br,
> Robert Matusewicz
>
> --
>
> ---
> 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/.
>
--
---
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/.
--bcaec548a13da5206905081d7774
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">This is the sort of thing that could be achieved with an a=
ttribute and a compiler warning flag. Since I don't know of any compile=
rs with that option, it doesn't look that important to add to the stand=
ard. However, if you can convince your compiler's implementer to add it=
, and folks wind up liking it, that would be a good argument for standardiz=
ation.</div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sa=
t, Nov 15, 2014 at 2:52 PM, <span dir=3D"ltr"><<a href=3D"mailto:matekm=
@gmail.com" target=3D"_blank">matekm@gmail.com</a>></span> wrote:<br><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex"><div dir=3D"ltr"><span style=3D"font-family:ari=
al;font-size:small">Hi,</span><div style=3D"font-family:arial;font-size:sma=
ll"><br></div><div style=3D"font-family:arial;font-size:small">What I lack =
in C++ is 'interface' keyword that would enforce some common constr=
ains for the class. I mean, when user define a class with an 'interface=
' keyword =C2=A0instead of 'class', then following checks would=
be performed:</div><div style=3D"font-family:arial;font-size:small">* is d=
estructor virtual? If no - then error,</div><div style=3D"font-family:arial=
;font-size:small">* are all methods pure virtual? If no - error.</div><div =
style=3D"font-family:arial;font-size:small"><br></div><div style=3D"font-fa=
mily:arial;font-size:small">Those are two requirements that are important t=
o me, but I think that allowing for constexpr/static const variables in int=
eraface definition would be also ok.</div><div style=3D"font-family:arial;f=
ont-size:small"><br></div><div style=3D"font-family:arial;font-size:small">=
What do you think about that idea?</div><div style=3D"font-family:arial;fon=
t-size:small"><br></div><div style=3D"font-family:arial;font-size:small">Br=
,</div><div style=3D"font-family:arial;font-size:small">Robert Matusewicz</=
div></div><span class=3D"HOEnZb"><font color=3D"#888888">
<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>
</font></span></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 />
--bcaec548a13da5206905081d7774--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Tue, 18 Nov 2014 10:34:25 +0200
Raw View
On 18 November 2014 09:50, Robert Matusewicz <matekm@gmail.com> wrote:
> Hi,
>
> 2014-11-17 1:21 GMT+01:00 Daniel Gutson <danielgutson@gmail.com>:
>>
>> FWIW, I asked Bjarne about this in Rapperswil. He referred to his "famous
>> time machine", in the sense that this should have been defined 15 years ago.
>
>
> Well, such addition would be very usefull in enviorment where I'm working,
> but from what I see, it looks like most ppl think this isn't important.
I don't quite grasp why your proposed rules are what they are. I don't see why
the destructor must be virtual, and I don't see why all functions must
be pure virtual.
The motivation for such an "interface" is so lacking that it's very
hard to see any
reason to support the idea.
--
---
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: =?UTF-8?Q?David_Rodr=C3=ADguez_Ibeas?= <dibeas@ieee.org>
Date: Wed, 26 Nov 2014 18:02:11 +0000
Raw View
--001a11c2cf46b7ba190508c6d3ab
Content-Type: text/plain; charset=UTF-8
My 2c. Rather than adding a new keyword with the additional complications,
an attribute could be added to the standard (if the feature is deemed
important), something as:
class [[interface]] ISomethingOrOther { ... };
I don't agree on the destructor having to be virtual, the options are
public and virtual if you intend on allowing 'delete' through a pointer to
base, or protected non-virtual if you don't want to allow that. This
particular issue is already warned by compilers, so I see little value in
making it an error.
David
P.S. Out of the list of restrictions you did not mention that it should not
have data members, or that inheritance from non-interfaces should also be
forbidden...
P.S.2. You mention that it would be very helpful in the environment you are
working on. I am curious as of how. In my company we have "protocols"
(different name for the same concept, don't kill the messenger) but the
restrictions are handled through code review, and to be honest I have never
seen any violation of this rules mentioned in a code review. How frequently
would you expect the compiler to help here? Changing the standard to force
a change in compilers to detect an issue that does not happen in real code
seems a bit overreaching.
On Tue Nov 18 2014 at 3:34:26 AM Ville Voutilainen <
ville.voutilainen@gmail.com> wrote:
> On 18 November 2014 09:50, Robert Matusewicz <matekm@gmail.com> wrote:
> > Hi,
> >
> > 2014-11-17 1:21 GMT+01:00 Daniel Gutson <danielgutson@gmail.com>:
> >>
> >> FWIW, I asked Bjarne about this in Rapperswil. He referred to his
> "famous
> >> time machine", in the sense that this should have been defined 15 years
> ago.
> >
> >
> > Well, such addition would be very usefull in enviorment where I'm
> working,
> > but from what I see, it looks like most ppl think this isn't important.
>
>
> I don't quite grasp why your proposed rules are what they are. I don't see
> why
> the destructor must be virtual, and I don't see why all functions must
> be pure virtual.
> The motivation for such an "interface" is so lacking that it's very
> hard to see any
> reason to support the idea.
>
> --
>
> ---
> 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/.
>
--
---
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/.
--001a11c2cf46b7ba190508c6d3ab
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
My 2c. Rather than adding a new keyword with the additional complications, =
an attribute could be added to the standard (if the feature is deemed impor=
tant), something as:<br><br>class [[interface]] ISomethingOrOther { ... };<=
br><br>I don't agree on the destructor having to be virtual, the option=
s are public and virtual if you intend on allowing 'delete' through=
a pointer to base, or protected non-virtual if you don't want to allow=
that. This particular issue is already warned by compilers, so I see littl=
e value in making it an error.<br><br>=C2=A0 =C2=A0 David<br><br>P.S. Out o=
f the list of restrictions you did not mention that it should not have data=
members, or that inheritance from non-interfaces should also be forbidden.=
...<br><br>P.S.2. You mention that it would be very helpful in the environme=
nt you are working on. I am curious as of how. In my company we have "=
protocols" (different name for the same concept, don't kill the me=
ssenger) but the restrictions are handled through code review, and to be ho=
nest I have never seen any violation of this rules mentioned in a code revi=
ew. How frequently would you expect the compiler to help here? Changing the=
standard to force a change in compilers to detect an issue that does not h=
appen in real code seems a bit overreaching.<div><br></div><br><div class=
=3D"gmail_quote">On Tue Nov 18 2014 at 3:34:26 AM Ville Voutilainen <<a =
href=3D"mailto:ville.voutilainen@gmail.com">ville.voutilainen@gmail.com</a>=
> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">On 18 November 2014 09:50, Ro=
bert Matusewicz <<a href=3D"mailto:matekm@gmail.com" target=3D"_blank">m=
atekm@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> 2014-11-17 1:21 GMT+01:00 Daniel Gutson <<a href=3D"mailto:danielgu=
tson@gmail.com" target=3D"_blank">danielgutson@gmail.com</a>>:<br>
>><br>
>> FWIW, I asked Bjarne about this in Rapperswil. He referred to his =
"famous<br>
>> time machine", in the sense that this should have been define=
d 15 years ago.<br>
><br>
><br>
> Well, such addition would be very usefull in enviorment where I'm =
working,<br>
> but from what I see, it looks like most ppl think this isn't impor=
tant.<br>
<br>
<br>
I don't quite grasp why your proposed rules are what they are. I don=
9;t see why<br>
the destructor must be virtual, and I don't see why all functions must<=
br>
be pure virtual.<br>
The motivation for such an "interface" is so lacking that it'=
s very<br>
hard to see any<br>
reason to support the idea.<br>
<br>
--<br>
<br>
---<br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@<u></u>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/<u></u>isocpp.=
org/group/std-<u></u>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 />
--001a11c2cf46b7ba190508c6d3ab--
.