1
2
3
4
5
6
7
8
9
10
11
|
#ifndef EMPATHY_UTIL_STRINGID_H
#define EMPATHY_UTIL_STRINGID_H
namespace empathy::util
{
class StringId
{
public:
StringId() {}
explicit StringId( const string& str );
explicit StringId( string&& str );
|
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
|
#ifndef GOOSE_UTIL_STRINGID_H
#define GOOSE_UTIL_STRINGID_H
namespace goose::util
{
class StringId
{
public:
StringId() {}
explicit StringId( const string& str );
explicit StringId( string&& str );
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
const string* m_pString = nullptr;
static unordered_set< string > m_strings;
};
}
namespace std
{
template<> struct hash< empathy::util::StringId >
{
size_t operator()( const empathy::util::StringId& x ) const
{
return hash< const char* >()( x.c_str() );
}
};
}
static inline auto operator "" _sid( const char* pString, std::size_t s )
{
return empathy::util::StringId( pString, s );
}
#endif
|
|
|
|
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
const string* m_pString = nullptr;
static unordered_set< string > m_strings;
};
}
namespace std
{
template<> struct hash< goose::util::StringId >
{
size_t operator()( const goose::util::StringId& x ) const
{
return hash< const char* >()( x.c_str() );
}
};
}
static inline auto operator "" _sid( const char* pString, std::size_t s )
{
return goose::util::StringId( pString, s );
}
#endif
|