Is there a way to choose the generic type of a class at runtime or is this a compile-time thing in C++?
What I want to do is something like this (pseudocode):
The closest you'll get is:
template void do_stuff_with_list { list myList; ... } enum Type { Integer = 1, String }; void do_stuff(Type type) { switch (type) { case Integer: do_stuff_with_list(); break; case String: do_stuff_with_list(); break; }; }