使用using代替typedef.md

Item9 使用 using 代替 typedef 1.类型声明 //Type declication typedef std::unique_ptr<std::unordered_map<std::string,Wiget>> UPtrMapSW_T; using UPtrMapSW_U = std::unique_ptr<std::unordered_map<std::string,Wiget>>; 2.函数声明 typedef void (*FP_T)(int,const std::string&); using FP_U=void(*)(int,const std::string&); 3.标准模板库 template<typename T> using MyAllocList_U = std::list<T>; void UseMyAllocList_U() { MyAllocList_U<Wiget> wList; } template<typename T> struct MyAllocList_T{ typedef std::list<T> type; }; void UseMyAllocList_T() { MyAllocList_T<Wiget>::type wList; } 4. C