Hey everybody,
while enjoying the book "SFML Game Development", I came across some code (page 58), which I really don't understand. In the header file of the class SceneNode, which publicly inherits from sf::Drawable, it says:
virtual void draw(...) const;
The reader is being recommended declare draw(...) with the C++0x
final keyword, which I think makes sense. (I would also recommend the
override keyword.)
Question: Why do they use the
virtual keyword? I mean, draw(...) is being inherited from sf::Drawable, but that doesn't require the use of
virtual, does it? Furthermore,
virtual implies that the function is designed to be overridden, which clearly isn't the case (as implied by
final)...
Is this an error or do I just not understand what's going on?