std::hash fixed for compile on linux

This commit is contained in:
fasiondog 2021-03-26 01:22:40 +08:00
parent 6b316eda1c
commit 816557a3d6
2 changed files with 6 additions and 4 deletions

View File

@ -297,8 +297,9 @@ inline bool Stock::operator==(const Stock& stock) const {
namespace std {
template <>
struct std::hash<hku::Stock> {
std::size_t operator()(hku::Stock const& stk) const noexcept {
class hash<hku::Stock> {
public:
size_t operator()(hku::Stock const& stk) const noexcept {
return stk.id(); // or use boost::hash_combine
}
};

View File

@ -369,8 +369,9 @@ inline Datetime Datetime::operator-(TimeDelta d) const {
namespace std {
template <>
struct std::hash<hku::Datetime> {
std::size_t operator()(hku::Datetime const& d) const noexcept {
class hash<hku::Datetime> {
public:
size_t operator()(hku::Datetime const& d) const noexcept {
return d.number(); // or use boost::hash_combine
}
};