It should be:
template
bool MutableQueue
{
scoped_lock lock(mutex);
return queue.empty();
}
And if your code is that short, just inline it, as you can’t separate the implementation and header of a template class anyway.
Use:
template
bool MutableQueue
{
…
}