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:
Benoit Steiner 2016-03-31 14:44:55 -07:00
parent 92b7f7b650
commit 0ea7ab4f62

View File

@ -415,12 +415,14 @@ using ::sqrt;
using ::floor;
using ::ceil;
#if __cplusplus > 199711L
template <>
struct hash<Eigen::half> {
size_t operator()(const Eigen::half& a) const {
return std::hash<unsigned short>()(a.x);
}
};
#endif
} // end namespace std