For the code below:
#include #include using namespace std; class Foo2; class Foo3; template class Foo1 { pub
Combining the bits, it seems like this should work:
int main() { std::list > list; list.push_back(Foo2()); list.push_back(Foo3()); printAll(list); // You'd still need to write this obviously. return 0; }