#include <iostream> using namespace std; template <typename T> struct Foo : T { int x; }; struct Bar { int y; }; int main() { Bar* x = new Foo<Bar>(); std::cout << x->x; // your code goes here return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:11:18: error: ‘struct Bar’ has no member named ‘x’ std::cout << x->x; ^
Standard output is empty