BMJ, that avatar isn't you is it? :eek: scary..
Printable View
BMJ, that avatar isn't you is it? :eek: scary..
Pure virtual is used as the base of an inheritance hierarcy so as to remove any further generalization of the hierarchy.
we all know what pure virtual is, he was asking what pure virtual destructors did for us
It removes any further generalization.
grr.... what?? :confused:
(this sure is fun isn't it)
meaning you can't put a base class above it?
Yeah. You can't break the implementation.
I am trying to get a pure virtual destructor to compile and it won't even do that!
something wrong with this?Code:class test
{
public:
test();
virtual ~test()=0;
};
class test1 : public test
{
public:
test1();
~test1();
};
test::test()
{
std::cout << "test()" << std::endl;
}
test1::test1()
{
std::cout << "test1()" << std::endl;
}
test1::~test1()
{
std::cout << "~test1()" << std::endl;
}
It is now!Quote:
Originally posted by FillYourBrain
that avatar isn't you is it?
Just use:Quote:
Originally posted by FillYourBrain
I am trying to get a pure virtual destructor to compile and it won't even do that!
something wrong with this?Code:class test
{
public:
test();
virtual ~test()=0;
};
virtual ~test();
And only make member functions pure virtual with the = 0; Not the destructor. Try that. Write a member function for it too.
are you saying "virtual ~test()=0" is illegal or it wont do anything?
There is no such thing as a pure virtual destructor.
It's just a virtual destructor.
I think it's illegal. I'm a Cer though not a C++er, but yeah, it's illegal.Quote:
Originally posted by BMJ
are you saying "virtual ~test()=0" is illegal or it wont do anything?
What? Pure virtual destructors are legal; which is why I ask how and where they would be used