Character Array as a value in C++ map

后端 未结 4 1262
一个人的身影
一个人的身影 2021-01-05 13:38

I want to define something like

Map myMap;

The above declaration is accepted by c++ compiler and no error is thrown bu

4条回答
  •  遥遥无期
    2021-01-05 14:25

    According to documentation pair can hold (and be defined for) distinct classes. C array is not a class, but a construct. You must define your own class with overloaded operator[](). Might need comparison operators as well

提交回复
热议问题