From a7d6efc5201960b351fee4760663388dd946ab8e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 7 Aug 2018 13:31:57 -0400 Subject: common: Convert type traits templates over to variable template versions where applicable Uses the C++17 inline variable variants --- src/common/hash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/hash.h') diff --git a/src/common/hash.h b/src/common/hash.h index 73c326980..2c761e545 100644 --- a/src/common/hash.h +++ b/src/common/hash.h @@ -28,7 +28,7 @@ static inline u64 ComputeHash64(const void* data, size_t len) { */ template static inline u64 ComputeStructHash64(const T& data) { - static_assert(std::is_trivially_copyable(), + static_assert(std::is_trivially_copyable_v, "Type passed to ComputeStructHash64 must be trivially copyable"); return ComputeHash64(&data, sizeof(data)); } @@ -38,7 +38,7 @@ template struct HashableStruct { // In addition to being trivially copyable, T must also have a trivial default constructor, // because any member initialization would be overridden by memset - static_assert(std::is_trivial(), "Type passed to HashableStruct must be trivial"); + static_assert(std::is_trivial_v, "Type passed to HashableStruct must be trivial"); /* * We use a union because "implicitly-defined copy/move constructor for a union X copies the * object representation of X." and "implicitly-defined copy assignment operator for a union X -- cgit v1.2.3