Trick to generate compiler error if "wrong" function called
Posted on 2007-03-28
In C++ does anybody know a trick to ensure that a function is never called though its definition does exist? The compiler would generate an error if this function is called.
I have a hierarchy of classes that contain a parallel template inner classes hierarchy. These inner classes have a virtual function func(). I have a problem overriding this function in the derived specialized inner class.
This might be a separate issue but for now I would just be interested to know if a technique exists to catch a call to a "wrong" function in the compile time.