cql3: Add std::hash for column_identifier

It's needed for unordered_map.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
This commit is contained in:
Pekka Enberg
2015-02-06 10:20:20 +02:00
parent d895a5768b
commit ed45d19f72

View File

@@ -180,12 +180,6 @@ public:
}
#if 0
@Override
public final int hashCode()
{
return text.hashCode();
}
@Override
public final boolean equals(Object o)
{
@@ -199,6 +193,8 @@ public:
virtual sstring to_string() const {
return _text;
}
friend std::hash<column_identifier::raw>;
};
};
@@ -218,6 +214,12 @@ struct hash<cql3::column_identifier> {
}
};
template<>
struct hash<cql3::column_identifier::raw> {
size_t operator()(const cql3::column_identifier::raw& r) const {
return std::hash<sstring>()(r._text);
}
};
}