Skip to content

Commit

Permalink
Assert unique representation.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Mar 31, 2024
1 parent 9230567 commit 03ba883
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hasher.inl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ void Hasher::hash(const T &value) {

template <typename T>
void Hasher::hash_value(const T &value) {
// Ensure we use this only on POD types with no padding.
static_assert(std::is_trivially_copyable_v<T>);
static_assert(std::has_unique_object_representations_v<T>);
buffer.write(reinterpret_cast<const char *>(&value), sizeof(value));
}

Expand Down

0 comments on commit 03ba883

Please sign in to comment.