D
Daniel
What is an abstract base class called that has all pure virtual functions
and no implementation? Is there such a thing as a pure abstract base class?
and no implementation? Is there such a thing as a pure abstract base class?
What is an abstract base class called that has all pure virtual functions
and no implementation?
Is there such a thing as a pure abstract base class?
What is an abstract base class called that has all pure virtual functions
and no implementation? Is there such a thing as a pure abstract base class?
What is an abstract base class called that has all pure virtual functions
and no implementation? Is there such a thing as a pure abstract base class?
What is an abstract base class called that has all pure virtual
functions and no implementation? Is there such a thing as a pure
abstract base class?
Yes it is. In C++ interfaces are abstract classes.
Even in C++/CLI, which like .NET makes a distinction between interfaces
and reference types (called classes in C#), the keyword to create an
interface is "interface class".
Jochen Kalmbach said:Hi Ben!
No. An interface is an interface!
In C++/CLI you cannot derived from more tha one "class"... so an interface
*must* not be a class (or abstract) class. It is an interface.
This is not comparable with "normal" C++.
You can only derive from one class (abstract or not). And you can
"implement" many interfaces.
Isn't that waht I am saying?
Ben said:In C++/CLI, the word "class" is not synonymous with "reference type".
C++/CLI is not C#.
Armin Zingler said:If I may...
What's so special about this group is the CLI part. In this context a
class
is always meant to be a ref class. Therefore, I agree with Jochen that an
Ben said:Yes, in this group we talk about the C++/CLI compiler, writing
managed code using C++ syntax, and making managed and unmanaged C++
code talk to each other.
Except when it is an interface class, value class, or unmanaged
class... these are all "class types" in C++/CLI.
gcroot<T> is certainly an important part of C++/CLI but it is not a
ref class
I will reiterate my point: In C++/CLI, the word "class" is not
synonymous with "reference type".
class [snip unrelated comment on "the CLI part"]
is always meant to be a ref class. Therefore, I agree with Jochen
that an
Except when it is an interface class, value class, or unmanaged
class... these are all "class types" in C++/CLI.
The word "always" means always, that is, without an exception. A value
type
is called a value type, an interface an interface and a (ref) class
is called a class. There's no need to distinguish between
different "types of classes" because the word class itself is unambiguous.
MSFT's CLI specification
(http://msdn.microsoft.com/de-de/netframework/aa569283(en-us).aspx) does
not
even mention the word "interface class". It also says: "For historical
reasons 'value class' can be used instead of 'value type' although the
latter is preferred." (source: MS Partition I, 13.1, page 58)
Sure, if you want to make it more complicated than necessary, you can
declare the word "class" being ambiguous instead of just calling an
interface an interface and a value type value type. For my part, I do know
what a class is without asking which kind of class.
IMO, it is.
Armin said:Long story short: ;-)
You are absolutly right if you're talking about keywords. However, I
was talking about clarity in a discussion. As I say "interface" to
what you declare as "interface class" in source code, and as I say
"value type" what is declared as "value class", I'm used to say
"class" for what is written "ref class" in source code. I'm not an
MVP but I'm reading this group for a long time, so I can say in good
conscience that I'm not the only one using these terms this way - if
not talking about syntactical details. Maybe you can also understand
this point of view.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.