They are exactly the same. There is no difference between them other than that the first approach requires more typing and is potentially clearer.
More Related Contents:
- Calling virtual functions inside constructors
- Can I call a base class’s virtual function if I’m overriding it?
- C++ virtual function return type
- Is the ‘override’ keyword just a check for a overridden virtual method?
- What are the differences between overriding virtual functions and hiding non-virtual functions?
- Override a member function with different return type
- Force all classes to implement / override a ‘pure virtual’ method in multi-level inheritance hierarchy
- Overriding public virtual functions with private functions in C++
- can a pure virtual function has parameters?
- Why does an overridden function in the derived class hide other overloads of the base class?
- Can a class member function template be virtual?
- How are virtual functions and vtable implemented?
- Are inline virtual functions really a non-sense?
- Alternative virtual function calls implementations?
- What is the ‘override’ keyword in C++ used for? [duplicate]
- Overriding a Base’s Overloaded Function in C++ [duplicate]
- C++ object size with virtual methods
- Differentiate between function overloading and function overriding
- Return Type Covariance with Smart Pointers
- What is the performance cost of having a virtual method in a C++ class?
- Overriding non-virtual methods
- Overriding static variables when subclassing
- How to enforce the ‘override’ keyword?
- Ways to detect whether a C++ virtual function has been redefined in a derived class
- Override and overload in C++
- C++ virtual override functions with same name
- Object oriented programming in Haskell
- Performance penalty for working with interfaces in C++?
- C++: Why does a struct\class need a virtual method in order to be polymorphic?
- list of polymorphic objects