Hello all,
Occasionally in C++ I find it useful to build an array which contains
classes of multiple different types all using the same interface -- by
constructing an array of pointers to some common base class, e.g.
class BaseClass {
// blah, blah ...
};
class A : BaseClass {
// ... bl
On 24/04/10 20:06, Joseph Wakeling wrote:
Hello all,
Occasionally in C++ I find it useful to build an array which contains
classes of multiple different types all using the same interface -- by
constructing an array of pointers to some common base class, e.g.
class BaseClass {
// blah, bla
Robert Clipsham wrote:
> This should do what you want:
Thanks! :-)
Is it possible to do this with an interface instead of a base class?
I'm not familiar with how the former work ...
Best wishes,
-- Joe
On 04/25/2010 04:47 PM, Joseph Wakeling wrote:
Robert Clipsham wrote:
This should do what you want:
Thanks! :-)
Is it possible to do this with an interface instead of a base class?
I'm not familiar with how the former work ...
Best wishes,
-- Joe
On 25/04/10 14:47, Joseph Wakeling wrote:
Robert Clipsham wrote:
This should do what you want:
Thanks! :-)
Is it possible to do this with an interface instead of a base class?
I'm not familiar with how the former work ...
Best wishes,
-- Joe
Yes it is, providing the base doesn't impl
Robert Clipsham wrote:
> interface I
> {
> int foobar();
> // The following line will cause an error when uncommented, as
> // you cannot implement methods in an interface
> // void baz() {}
> }
Just to be complete: interfaces can have static or final functions in D2:
static void ba