1. 程式人生 > >用char*作為map的key

用char*作為map的key

如下宣告:

struct cmp_str
{
    bool operator()(char const *a, char const *b)
    {
        return strcmp(a, b) < 0;
    }
};

static std::map<const char*, GhMemoryRecord*, cmp_str> g_oMemoryRecordAddressMap;