Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!olivea!samsung!noose.ecn.purdue.edu!ec.ecn.purdue.edu!helz From: helz@ec.ecn.purdue.edu (Randall A Helzerman) Newsgroups: comp.lang.c++ Subject: returning this from virtual functions. Message-ID: <1991Jan23.010422.20574@noose.ecn.purdue.edu> Date: 23 Jan 91 01:04:22 GMT Sender: news@noose.ecn.purdue.edu (USENET news) Organization: Purdue University Engineering Computer Network Lines: 13 A quick question about returning this from virtual functions. A virtual function was defined to return a pointer to the base class. Instead I return this. I have gotten it to compile with no errors in g++, but it gives me a warning in cfront. Could some net.guru++ tell me if this is an acceptable thing to do? If not, how would I return a pointer to the derived class in a virtual function, without casting to a void pointer? Many thanks in advance.