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):
         
        
I can't think of a situation where this would be useful, but…
#include "boost/variant.hpp"
#include 
#include 
boost::variant, std::list >
unknown(int someval) {
    if (someval == 1)
        return boost::variant, std::list >(
                std::list());
    else if (someval == 2)
        return boost::variant, std::list >(
                std::list());
}