I am trying to make a class that has a type that is decided by whatever type is passed to another class. Here is an example with all the unrelated stuff removed:
class foo_list{
private:
std::list<foo_template>list;
public:
template<class t>
void addToList(t data,(something else unrelated)){
list.push_back(new task<t>(data));
}
}
template<class t>
class foo_template{
private:
t data
someOtherStuffThatIsUnrelated
.
.
.
}
However something like this doesnt compile. Mainly because a template without a fixed type cant be used as a type for another template (or anything really).
What is the (correct) way to implement such a thing, preferrably with either full type information retained or a way to cast back to the original type.