prog.cpp:22:17: error: ‘virtual float Derived::getFloatImpl(const Example*)’ marked ‘override’, but does not override
virtual float getFloatImpl(const Example* ex) override {
^~~~~~~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:28:10: error: cannot declare variable ‘derived’ to be of abstract type ‘Derived’
Derived derived;
^~~~~~~
prog.cpp:20:7: note: because the following virtual functions are pure within ‘Derived’:
class Derived : public Base<Derived, Example> {
^~~~~~~
prog.cpp:10:17: note: float Base<D, T>::getFloat(const T*) const [with D = Derived; T = Example]
virtual float getFloat(const T* ex) const = 0;
^~~~~~~~
prog.cpp: In instantiation of ‘float Base<D, T>::getFloat(const FeaturesExample&) const [with D = Derived; T = Example]’:
prog.cpp:29:30: required from here
prog.cpp:12:8: error: reinterpret_cast from type ‘const FeaturesExample*’ to type ‘Example*’ casts away qualifiers
get(reinterpret_cast<T*>(&ex));
^~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:12:7: error: ‘get’ was not declared in this scope
get(reinterpret_cast<T*>(&ex));
~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~