mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 11:58:21 +08:00
std::hash fixed for compile on linux
This commit is contained in:
parent
6b316eda1c
commit
816557a3d6
@ -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
|
||||
}
|
||||
};
|
||||
|
@ -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
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user