Can I tell if a C++ virtual function is implemented
I want to be able to tell at run-time if an instance of a class implements a virtual function. For example: struct Base { virtual void func(int x) { <default behavior here> } virtual void func2(int x) { <default behavior here> } }; struct Deriv : Base { virtual void func(int x) override { <new behavior here> } }; int main() { Base *d = new Deriv; if(implements<Base::func(int)>(d)) // This should evaluate true {} if(implements<Base::func2(int)>(d)) // This should evaluate false {} } I have seen this but it's dated and there might be a something that c++11/14 has to say now: Ways to detect