#include<iostream>
using namespace std;
struct Base{
virtual void print(){cout << "Base"<< endl;}
};
struct Derrived : Base{
void print(){cout << "Derrived"<< endl;}
};
template< Base* arr,int size = 10>
class Template{
public:
void print(){arr->print();}
};
#include "template.h"
int main(){
Base *b = new Base();
Derrived *d = new Derrived();
Template<b> baseParam;
return 0;
}
Why does this doesn't compile:
Template<b> baseParam;
Thank you!