我尝试使用指针实例化模板类,例如:
vector<*vector<int> >
但它行不通。Complier(g++) 表示"模板参数 1 无效"。对这种情况有任何想法吗?这是我写错了还是模板类本质上无法通过指针实例化。
多谢。
你可以
这样做:
std::vector<std::vector<int>*> vector_of_pointers_to_vector_of_ints;