diff options
| author | 2018-08-07 13:31:57 -0400 | |
|---|---|---|
| committer | 2018-08-07 19:34:47 -0400 | |
| commit | a7d6efc5201960b351fee4760663388dd946ab8e (patch) | |
| tree | aea37b49caa9b3b71a98a1266d7786ac39079e2f /src/common/hash.h | |
| parent | Merge pull request #971 from DarkLordZach/mbedtls-2.12.0 (diff) | |
| download | yuzu-a7d6efc5201960b351fee4760663388dd946ab8e.tar.gz yuzu-a7d6efc5201960b351fee4760663388dd946ab8e.tar.xz yuzu-a7d6efc5201960b351fee4760663388dd946ab8e.zip | |
common: Convert type traits templates over to variable template versions where applicable
Uses the C++17 inline variable variants
Diffstat (limited to '')
| -rw-r--r-- | src/common/hash.h | 4 |
1 files changed, 2 insertions, 2 deletions
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) { | |||
| 28 | */ | 28 | */ |
| 29 | template <typename T> | 29 | template <typename T> |
| 30 | static inline u64 ComputeStructHash64(const T& data) { | 30 | static inline u64 ComputeStructHash64(const T& data) { |
| 31 | static_assert(std::is_trivially_copyable<T>(), | 31 | static_assert(std::is_trivially_copyable_v<T>, |
| 32 | "Type passed to ComputeStructHash64 must be trivially copyable"); | 32 | "Type passed to ComputeStructHash64 must be trivially copyable"); |
| 33 | return ComputeHash64(&data, sizeof(data)); | 33 | return ComputeHash64(&data, sizeof(data)); |
| 34 | } | 34 | } |
| @@ -38,7 +38,7 @@ template <typename T> | |||
| 38 | struct HashableStruct { | 38 | struct HashableStruct { |
| 39 | // In addition to being trivially copyable, T must also have a trivial default constructor, | 39 | // In addition to being trivially copyable, T must also have a trivial default constructor, |
| 40 | // because any member initialization would be overridden by memset | 40 | // because any member initialization would be overridden by memset |
| 41 | static_assert(std::is_trivial<T>(), "Type passed to HashableStruct must be trivial"); | 41 | static_assert(std::is_trivial_v<T>, "Type passed to HashableStruct must be trivial"); |
| 42 | /* | 42 | /* |
| 43 | * We use a union because "implicitly-defined copy/move constructor for a union X copies the | 43 | * We use a union because "implicitly-defined copy/move constructor for a union X copies the |
| 44 | * object representation of X." and "implicitly-defined copy assignment operator for a union X | 44 | * object representation of X." and "implicitly-defined copy assignment operator for a union X |