Re: Future of C++
Andre Kaufmann wrote:
Eugene Gershnik wrote:
On Aug 11, 3:27 pm, Andre Kaufmann <akfmn...@t-online.de> wrote:
[...]
This is getting rather platform specific but I hope moderators will
let this through since at least some of it applies to standard C++.
I think it gets too proprietary too - so I try to be more C++
specific.
1. Both these attributes do *not* say that the class they apply to
is a COM interface. The first one is a nice optimization for any
abstract [...]
No, but would it make sense for a C++ compiler to make a destructor
automatically virtual if a class has the novtable attribute ?
No, how could it?
By the way, C++ already does make functions automatically virtual,
if a hidden function in the base class is changed to a virtual
function.
That's part of the current language, not a change for existing code.
I repeat: there is NO way for the compiler to detect that a
certain C++ class is used as a COM interface
If the C++ compiler can't detect it, how is the binary
compatibility of the COM - ABI with the other languages and other
C++ compilers ensured ? Or are you just assuming that the VTABLE of
a C++ compiler matches with the proprietary COM specifications ?
Yes, if the compiler documentation says that it is COM compliant, I
would assume that it is. :-)
We are talking about language changes that would make existing code
non-compliant.
[...]
Interface = Pure abstract means only abstract functions for me -
and is the definition of interfaces in other languages - even no
destructor. Which is not possible in C++.
has a constructor and destructor even if the user doesn't write
them down.
Yes, this is why C++ has no "true" interfaces. Would be perhaps a
good idea to add interfaces to C++, because the additional code for
the destructor could be omitted.
How much code do you think there is in the default destructor for a
base class without any data members? None, would be a good guess.
Bo Persson
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]