本文翻译自《effective modern C++》,由于水平有限,故无法保证翻译完全正确,欢迎指出错误。谢谢!
博客已经迁移到这里啦
我确信我们都同意使用STL容器是一个好主意,并且我希望在Item 18中能让你相信使用std::unique_ptr也是一个好主意,但是我猜想,我们中没有任何一个人想多次写这样的类型:“std::unique_ptr
你要记住的事
typedef不支持模板化,但是别名声明(alias declaration)支持。
alias templates避免了“::type”后缀,以及在template中“typename”前缀(当代表一个类型时)的使用。
- C++14提供所有C++11 type traits 转换的alias templates版本。