Is it ok to mark all pure virtual methods as private

I have recently noticed that pure virtual methods marked private: in a base class seem to work fine in the derived class. I would have thought they needed to be marked protected:

My questions are is it ok to do this?
Are there any specific rules concerning this?
Is it bad or good programming practice?
It is fine for pure virtual methods to be marked private. It is also good practice, see here ( http://isocpp.org/wiki/faq/strange-inheritance#private-virtuals ) and here ( http://www.gotw.ca/publications/mill18.htm ) for more details.
Last edited on
If you are not planning to call them from outside the class it's perfectly alright.
Thankyou both.

@Peter87 Wow it amazes me that you are always answering my questions +1Thanks.
Last edited on
Topic archived. No new replies allowed.