在 C++11 中下面的两条语句表达的都是一个意思,
typedef int MyInt; using MyInt = int;
同时 using 还可在模板中使用,
using
emplate<class T> using MyType = AnotherType<T, MyAllocatorType>;
typedef 和 using 除了 using 还可以在模板中使用,其它的都是等同的。
typedef
本文分享自 作者个人站点/博客?前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与?腾讯云自媒体分享计划? ,欢迎热爱写作的你一起参与!