Skip to content

hash_map在 linux下编译错误 #4

@mepwang

Description

@mepwang

环境:LinuxMint 17.1-64bit
现象: hash_map编译错误

描述:
在Linux下hash_map的实现和VC++上稍有不同,在使用hash_map的文件中增加下面的语句:

using namespace __gnu_cxx;

namespace __gnu_cxx
{
template<> struct hash
{
size_t operator()(const string& s) const
{ return hash<const char*>()( s.c_str() ); } //__stl_hash_string
};
template<> struct hash
{
size_t operator()(const string& s) const
{ return hash<const char*>()( s.c_str() ); }
};
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions