【发布时间】:2016-04-23 05:51:06
【问题描述】:
假设我有这个 typedef
typedef std::pair<std::string, uint32_t> MyType;
那么,如果我也想使用 MyType 创建地图,我该怎么做呢?
我不想重新键入这对中的两种类型,例如:
map<std::string, uint32_t> myMap;
我想要类似的东西:
map<MyType's first type, MyType's second type> myMap;
有没有办法使用我的 typedef MyType 而不是重新键入类型来做到这一点?
【问题讨论】:
标签: c++ dictionary typedef std-pair