Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
No polymiorphism for virtual operator= ?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="jpalecek, post: 2982514"] .... boring and irrelevent stuff deleted ... No. It is because, you have acually two operator='s in F2. The first inherited from Fraction and taking Fraction& as rhs and the second new one with F2 as rhs. To actually override the Fraction's opertator=, you need the operator= to have exactly the same arguments, ie. Fraction2& Fraction2::operator=(const Fraction&); I think (but am not sure) it's possible to return Fraction2 here. You will probably have to use dynamic_cast to downcast the rhs from Fraction to Fraction2 Regards Jiri Palecek [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
No polymiorphism for virtual operator= ?
Top