typedef std::unique_ptr<std::unordered_map<std::string, std::string>> UPtrMapSS; using UPtrMapSS = std::unique_ptr<std::unordered_map<std::string, std::string>>;
上面这两种方式看不出孰优孰劣,但如果在函数指针的情况下:
1 2 3 4 5 6
// FP is a synonym for a pointer to a function taking an int and // a const std::string& and returning nothing typedefvoid(*FP)(int, const std::string&); // typedef // same meaning as above using FP = void (*)(int, const std::string&); // alias // declaration