我typedef该template class怎么办?就像是:
typedef std::vector myVector; // <--- compiler error
Run Code Online (Sandbox Code Playgroud)
我知道两种方式:
(1) #define myVector std::vector // not so good
(2) template<typename T>
struct myVector { typedef std::vector<T> type; }; // verbose
Run Code Online (Sandbox Code Playgroud)
我们在C++ 0x中有更好的东西吗?