79197193

Date: 2024-11-17 12:40:04
Score: 2
Natty:
Report link

Since you need to insert a pair to the map, you can also use emplace instead of insert, so it will construct the pair in-place with the given key and value. https://en.cppreference.com/w/cpp/container/unordered_map/emplace

map.emplace("string", std::make_shared<ClassB>());
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Zipzap