Suppose that in one old project (> 1M lines) there is a class with a name Basethat has two virtual functions fooandbar
class Base
{
public:
virtual void foo();
virtual void bar();
};
class Derived: public Base
{
public:
virtual void foo();
virtual void bar();
};
I suspect it is Basenot used polymorphically, therefore foo/ barshould not be virtual.
To confirm my ideas, I need to find out if there is such an operator:
Base *b = new Derived;
but if we pass a pointer among the function, it would be difficult to know, for example:
Base *f()
{
...
Derived *d = ;
...
return d;
}
Is there any way to do this?
source
share