martinus / robin-hood-hashing

Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
https://gitter.im/martinus/robin-hood-hashing
MIT License
1.5k stars 142 forks source link

Enable std::is_trivially_copyable in clang #166

Closed avitase closed 1 year ago

avitase commented 1 year ago

Clang has this weird behavior of setting __GNUC__ to 4, hence clang will always take the if branch. This is suboptimal because std::is_trivially_copyable has almost always been in clang. This patch should fix it.

Note that starting with clang 15 a warning is raised for the current implementation: warning: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Wdeprecated-builtins]

martinus commented 1 year ago

Thanks! I've merged it