prog.cpp:10:32: error: need ‘typename’ before ‘D::ExampleType’ because ‘D’ is a dependent scope
virtual float getFloat(const D::ExampleType* ex) const = 0;
^
prog.cpp: In member function ‘float Base<D>::getFloat(const FeaturesExample&) const’:
prog.cpp:12:25: error: need ‘typename’ before ‘D::ExampleType’ because ‘D’ is a dependent scope
get(reinterpret_cast<D::ExampleType>(&ex));
^
prog.cpp:12:45: error: there are no arguments to ‘get’ that depend on a template parameter, so a declaration of ‘get’ must be available [-fpermissive]
get(reinterpret_cast<D::ExampleType>(&ex));
^
prog.cpp:12:45: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
prog.cpp: At global scope:
prog.cpp:22:11: error: ‘ExampleType’ does not name a type
typedef ExampleType = Example;
^~~~~~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:29: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> {
^~~~~~~
prog.cpp:10:17: note: float Base<D>::getFloat(const int*) const [with D = Derived]
virtual float getFloat(const D::ExampleType* ex) const = 0;
^~~~~~~~
prog.cpp: In instantiation of ‘float Base<D>::getFloat(const FeaturesExample&) const [with D = Derived]’:
prog.cpp:30:30: required from here
prog.cpp:12:45: error: ‘get’ was not declared in this scope
get(reinterpret_cast<D::ExampleType>(&ex));
^