我想做
typedef deque type; //error, use of class template requires template argument list
type<int> container_;
但是那个错误阻止了我。我该怎么做?
最佳答案
你不能(直到 C++0x)。但它可以模拟:
template<typename T>
struct ContainerOf
{
typedef std::deque<T> type;
};
用作:
ContainerOf<int>::type container_;
关于c++ - typedef 标准容器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/562209/