Reputation: 606
i can't find what's wrong with this code:
template <class T>
class B{
T _t;
public:
B(T t) : _t(t) {}
void printHello();
};
template <class T>
void B<T>::printHello(){
std::cout << "Hello";
}
void B<char*>::printHello(){
std::cout <<"Good bye!";
}
I keep getting:
'error: too few template-parameter-lists'
Upvotes: 0
Views: 2371
Reputation: 92864
template<>
is missing before the specialization
template<>
void B<char*>::printHello(){
std::cout <<"Good bye!";
}
Upvotes: 3