Alfonso Morra wrote:
if I have a template class declared as ff:
It's not a template class. It's a class template.
template <typename T>
class A {
public:
//usual ctors and dtor cut to save space
T& get( void ) ;
void set( const T&) ;
private:
T x ;
};
How I can I store such an object in a vector like this:
std::vector< A > vector_of_a ; //<- this is pseudocode
You can't. std::vector requires _a_type_ as its first argument, not
a template. Think about it. What "object" are you going to store?
What is 'T'? If it's something concrete, like 'int', then you need
to specify it. If it's not anything concrete, then how would the
vector know how much storage to allocate for it?
V