code:
template >
class stack
{
public:
stack() {}
temp
That default parameter is, by syntax, a default parameter to the class, and it only makes sense at the class declaration.
If you would call that function ...
stack<foo,bar>().empty();
you only have the template parameters on the site of the class name, for which you already provided default parameters at the point of the template class declaration.
You can solve the issue by simply removing the default parameter from the function definition:
template<typename element_type,typename container_type>
bool stack<element_type,container_type>::empty(){
return container.empty();
}
You attempt to provide a default argument for the second template parameter to stack
twice. Default template arguments, just like default function arguments, may only be defined once (per translation unit); not even repeating the exact same definition is allowed.
Just type the default argument at the beginning where you define the class template. After that, leave it out:
template<typename element_type,typename container_type>
bool stack<element_type,container_type>::empty(){
return container.empty();
}