64,676
社区成员
发帖
与我相关
我的任务
分享
namespace std
{
// for VS
template<>
struct less<char*>: public binary_function<char*, char*, bool>
{
public:
bool operator()(const char* l, const char* r) const
{
while (*l || *r)
{
if (*l != *r)
return *l < *r;
++r;
++l;
}
return false;
}
};
// for g++
template<>
struct equal_to<char*>: public binary_function<char*, char*, bool>
{
public:
bool operator()(const char* l, const char* r) const
{
while (*l || *r)
{
if (*l++ != *r++)
return false;
}
return true;
}
};
};
strcpy(buf,"abc");
hashMap[buf] = "abc";