sgorsten / linalg

linalg.h is a single header, public domain, short vector math library for C++
The Unlicense
854 stars 68 forks source link

Fix compiler bug in gcc 10.1 #24

Closed quinor closed 4 years ago

quinor commented 4 years ago

In gcc 10.1 std::hash is not visible and the specializations template<class T> struct hash<linalg::vec<T,1>> do not work due to the original struct hash not being visible. Fix it by including <functional>. where std::hash is defined.

sgorsten commented 4 years ago

Thanks for the catch.

I kinda wish I hadn't specialized std::hash<T> in the first place, as it's not that hard for the end-user to do it themselves if they really need it and <functional> has a pretty large impact on compile times on a number of platforms.

Still, building on modern toolchains will have to take priority.