I
Ian McBride
Plus or minus a few typos, in the pseudo-program below, which delete
operator gets called, Base1's delete or the default delete?
Thanks for any help..
--
class Base1
{
public:
void operator delete(void *);
void * operator new(int size);
};
class Base2
{
public:
virtual ~Base2();
Dispose()
{
delete this;
}
};
class Derive : virtual public Base1, virtual public Base2
{
int MemberVar;
};
main()
{
Base2 * p = new Derive;
p->Dispose();
}
--
operator gets called, Base1's delete or the default delete?
Thanks for any help..
--
class Base1
{
public:
void operator delete(void *);
void * operator new(int size);
};
class Base2
{
public:
virtual ~Base2();
Dispose()
{
delete this;
}
};
class Derive : virtual public Base1, virtual public Base2
{
int MemberVar;
};
main()
{
Base2 * p = new Derive;
p->Dispose();
}
--