I have a template class named Cell as follows:-
templateclass Cell
{
string header, T data;
}
Now I want another class N
Something like this?
template
class Row
{
private:
std::vector > cells;
};
|
Okay, this answer is incorrect.
So, if you want to store in one vector
different cells - you should use some dynamic type identification (you can use one base-class and store pointer to it in vector, that use only virtual functions, that are overrided in all derived classes, you can store something like boost::any
and save some type-identification
for each inserted element, for cast them into real type and work with it).