MyMap my;
my["one"] = 1;
my["second"] = 2;
int res = my["one"];
class MyMap
{
private:
map<const char*, int> data;
public:
MyMap() {}
~MyMap() {}
int & operator [] (const char* name) { return data[name]; }
};
my.count() : 3
one : 1
two : 2
one : 0
res : 0
map<const char*, int>
map<std::string, int>
выглядит более здраво.