Is it possible to have the constructor in an interface call member functions
polymorphically? For instance:
==============================
// INTERFACE CLASS
class SomeInterface {
public:
virtual void foo()=0;
SomeInterface() { foo();}
};
// DERIVED CLASS
class Widget: public SomeInterface {
public:
void foo() { std::cout << "I am the widget" ;}
Widget(): SomeInterface() {};
};
//
int main() {
Widget w;
return 0;
}
================================
well, the compiler complains that there is no implementation for
"bla bla SomeInterface::foo()" (of course there isn't!)...
greetings,
levant.