我知道单个地图查询最多占用log(N)时间.但是我想知道,我已经看到很多使用字符串作为映射键的示例.例如,将std :: string作为键与地图而不是int相关联的性能成本是多少?
std::map<std::string, aClass*> someMap; VS std::map<int, aClass*> someMap;
std::map<std::string, aClass*> someMap;
std::map<int, aClass*> someMap;
谢谢!
c++ performance stl
c++ ×1
performance ×1
stl ×1