J
Jenny
Hi,
I have a class foo which will construct some objects in my code. some
of the objects store int values into the data deque, while others
store float values to the deque.
template <class TYPE>
class foo
{
protected:
std::string name;
std::deque<TYPE> data;
};
After the objects finish storing the data into deques. I need another
deque or something store the objects. I was trying to use
std::deque<foo> foo_list; to store the ojbects. Because class foo is a
template class, I can only construct it as std::deque<foo<int> >
foo_list; or std::deque<foo<float> > foo_list;
However I need a deque to store both foo<float> and foo<int>. Is there
any other way I can use to store the foo objects in a list?
I have a class foo which will construct some objects in my code. some
of the objects store int values into the data deque, while others
store float values to the deque.
template <class TYPE>
class foo
{
protected:
std::string name;
std::deque<TYPE> data;
};
After the objects finish storing the data into deques. I need another
deque or something store the objects. I was trying to use
std::deque<foo> foo_list; to store the ojbects. Because class foo is a
template class, I can only construct it as std::deque<foo<int> >
foo_list; or std::deque<foo<float> > foo_list;
However I need a deque to store both foo<float> and foo<int>. Is there
any other way I can use to store the foo objects in a list?