mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Hashing was only officially introduced in c++11. Therefore only define an implementation of the hash function for float16 if c++11 is enabled.
This commit is contained in:
parent
92b7f7b650
commit
0ea7ab4f62
@ -415,12 +415,14 @@ using ::sqrt;
|
|||||||
using ::floor;
|
using ::floor;
|
||||||
using ::ceil;
|
using ::ceil;
|
||||||
|
|
||||||
|
#if __cplusplus > 199711L
|
||||||
template <>
|
template <>
|
||||||
struct hash<Eigen::half> {
|
struct hash<Eigen::half> {
|
||||||
size_t operator()(const Eigen::half& a) const {
|
size_t operator()(const Eigen::half& a) const {
|
||||||
return std::hash<unsigned short>()(a.x);
|
return std::hash<unsigned short>()(a.x);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
} // end namespace std
|
} // end namespace std
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user