Using an std::string as a key for an std::map

前端 未结 1 1242
星月不相逢
星月不相逢 2020-12-17 09:15

I would like to have an std::map (int .NET 4.0). We of course know that a map is a tree and requires an operator< that string does not define for us.

相关标签:
1条回答
  • 2020-12-17 09:32

    Error 24 error C2676: binary '<' : 'const std::string' does not define this operator or a conversion to a type acceptable to the predefined operator c:\program files\microsoft visual studio 10.0\vc\include\xfunctional 125 1 FXCMMarketDataServer

    That's what VC spits into your face when you forgot to include <string>. That header definitely defines this operator.

    0 讨论(0)
提交回复
热议问题