Using map with class error, compile error

后端 未结 3 1917
自闭症患者
自闭症患者 2021-01-28 02:49

I have the following compiler error, how could I fix it?

error:  instantiated from `_Tp& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const _Key&a         


        
3条回答
  •  抹茶落季
    2021-01-28 03:31

    operator < must be available for the key type, or you should provide a comparison functor to the map constructor.

提交回复
热议问题