I have problem with my project, here is some test code, in project it looks same. Some of classes are plain but one of them is template class with 2 different types (class B) for example int and double.
class Bar
{
Bar()
{
}
};
template< typename _T >
class B
{
B();
};
template< typename _T >
B<_T>::B()
{
}
typedef B<int> Bint;
typedef B<double> Bdouble;
template< typename _T >
class Test
{
Test();
void method();
};
template< typename _T >
Test<_T>::Test()
{
}
template< typename _T >
void
Test<_T>::method()
{
}
template< >
void
Test< Bar >::method()
{
//do sth for Bar
}
I know i can do it by spcializing B<int>
and B<double>
for template argument but it doubles the code. Here is te problem, i want to specialize method for only template B class, is ther any way to do it ?
I know this code won't work :
template< >
void
Test< B< _T> >::method()
{
////do sth for B< _T >
}