BMJ, that avatar isn't you is it? scary..
BMJ, that avatar isn't you is it? scary..
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
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
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
grr.... what??
(this sure is fun isn't it)
meaning you can't put a base class above it?
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
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; }
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
It is now!Originally posted by FillYourBrain
that avatar isn't you is it?
Just use: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?
I think it's illegal. I'm a Cer though not a C++er, but yeah, it's illegal.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