Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
Enable std::is_trivially_copyable in clang (#166)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
avitase authored Jan 31, 2023
1 parent fb14836 commit bd63205
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/include/robin_hood.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static Counts& counts() {

// workaround missing "is_trivially_copyable" in g++ < 5.0
// See https://stackoverflow.com/a/31798726/48181
#if defined(__GNUC__) && __GNUC__ < 5
#if defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__)
# define ROBIN_HOOD_IS_TRIVIALLY_COPYABLE(...) __has_trivial_copy(__VA_ARGS__)
#else
# define ROBIN_HOOD_IS_TRIVIALLY_COPYABLE(...) std::is_trivially_copyable<__VA_ARGS__>::value
Expand Down

0 comments on commit bd63205

Please sign in to comment.