- Joined
- Apr 1, 2012
- Messages
- 1,249
- Solutions
- 71
- Reaction score
- 621
- Location
- Hell
- GitHub
- idontreallywolf
I've compiled 3777 sources from Fir3Element's repository and the same warning has been popping up through the whole compiling proccess..
the warning message is : ./condition.h:279:8: warning: 'ConditionDamage::updateCondition' hides overloaded virtual function [-Woverloaded-virtual]
I wasn't sure what a "virtual function" was, so I looked it up and found the following answer which made sense:
Then in condition.h I looked at line 279 and found the following:
also notcied that ConditionDamage was inheriting Condition.
in condition.h at line 145 ( Condition class ) I found the following.
now my question is why is
As far as I understood, that should be fine.
what would happen if I changed it to Condition instead (to work-around the warning)?
the warning message is : ./condition.h:279:8: warning: 'ConditionDamage::updateCondition' hides overloaded virtual function [-Woverloaded-virtual]
I wasn't sure what a "virtual function" was, so I looked it up and found the following answer which made sense:
Why do we need virtual functions in C++?
From what I've read, virtual functions are functions in the base class that you can override in its derived classes. But earlier, when learning about basic inheritance, I was able to override base
stackoverflow.com
Then in condition.h I looked at line 279 and found the following:
Code:
bool updateCondition(const ConditionDamage* addCondition);
Code:
class ConditionDamage: public Condition
in condition.h at line 145 ( Condition class ) I found the following.
Code:
virtual bool updateCondition(const Condition* addCondition);
now my question is why is
updateCondition
taking ConditionDamage*
as a parameter and not Condition*
?As far as I understood, that should be fine.
what would happen if I changed it to Condition instead (to work-around the warning)?