Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!ccut!wnoc-tyo-news!sranha!hxrdgw!ishii From: ishii@hexard.co.jp (Koji Ishii) Newsgroups: comp.lang.c++ Subject: How to detect virtual functions whether inherited or redefined? Message-ID: Date: 20 Mar 91 14:05:10 GMT Sender: news@hexard.co.jp Distribution: comp Organization: Hexard Inc., Tokyo, Japan. Lines: 22 Are there way to detect whether a virtual function is redefined in its sub classes or not? Say, there is a class A: class A { public: virtual int action(); int check(){ if (this->action != A::action){ ... } } }; In A::check(), I tried to activate a button if only action() is redefined in its sub classes, but my g++ 1.39.0 did not work as I expected. I wanted to know whether action() is redefined or not *before* calling action(), and am afraid of using another virtual function such as action_redefined_P() as I may redefine action() and forget to redefine action_redefined_P(). Is this impossible in C++, or am I going something wrong? Or are there any better solution? -- ---------------------------------- Koji Ishii Hexard Inc., Tokyo, Japan.