It isn't clear what happens if I delete a virtual method in C++0x:
virtual int derive_func() = delete;
Does this mean this class and everything that inherits from it can not define/implement the derive_func()
method? Or is this illegal/compile error?
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2326.html#delete
A deleted virtual function may not override a non-deleted virtual function and vice-versa.
meaning its pretty useless (as i read it at least) the only valid use would be:
struct A{
virtual void b() = delete;
};
struct B:A{
virtual void b() = delete;
};
which is completely useless, since the function can never be called. for non virtual functions the use is more justified
EDIT to be completely clear this is the ONLY possible relation, children may not implement and you may not delete a non-deleted inherited virtual.