There are couple of problems.
One was pointed out by @dyp in the comments section to your question. You need to use:
void Foo< ValA >::doSomething()
{
}
instead of
template<>
void Foo< ValA >::doSomething()
{
}
The other one is that you have to change the class template to:
template< int T >
struct Foo : virtual public Bar
{
};
You can't create a specialization of Foo
using ValA
, if you use typename as template parameter.