I am trying to find a way to check in a derived class whether a base class method is defined as "virtual". Basically, I would like to have the following code:
class A { virtual void vfoo() {} void foo() {} virtual ~A() {} }; class B : public A { virtual void vfoo() { MAGIC_CHECK(m_pA->vfoo());
The question is how to implement this MAGIC_CHECK? One solution to this might be to use -Woverloaded-virtual compilation. Can someone suggest a solution that won't include this flag?
Thanks!
source share