You cannot define a SetData( vector ) since std::vector needs a type, and obiously you cannot define SetData( std::vector< T > ) in the Base if you have no definition for T.
So if you really need this and think this is the way to go, you'll have to look into type dispatching (or make a hack using void*). Boost uses type dispatching in some places, else google provides examples.
edit simple example of what it can look like; not really type dispatching but more straightforward
class Base
{
public:
template< class T >
bool SetData( const std::vector< T >& t )
{
return SetData( static_cast< const void* >( &t ), typeid( t ) );
}
protected:
virtual bool SetData( const void*, const std::type_info& ) = 0;
};
template< class T >
class Derived : public Base
{
protected:
bool SetData( const void* p, const std::type_info& info )
{
if( info == typeid( std::vector< T > ) )
{
const std::vector< T >& v = *static_cast< const std::vector< T >* >( p );
//ok same type, this should work
//do something with data here
return true;
}
else
{
//not good, different types
return false;
}
}
};