Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 31,697 of 33,346    |
|    Dave Harris to Lorenzo Caminiti    |
|    Re: Covariant virtual function result ty    |
|    26 Nov 11 13:22:38    |
      8807a3ed       From: brangdon@cix.co.uk              lorcaminiti@gmail.com (Lorenzo Caminiti) wrote (abridged):       > When invoking a covariant virtual function, the derived function       > body is executed but the result type of the base function       > is returned. Is there any way to get C++ to return the result       > type of the derived function instead?              Only with a run-time test. For example:               if (y *py = dynamic_cast |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca