Skip to content

Commit

Permalink
bugfix for std::optional hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Oct 10, 2024
1 parent 3afab01 commit f54b3ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/cista/hashing.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct hashing {
} else if constexpr (is_strong_v<Type>) {
return hashing<typename Type::value_t>{}(el.v_, seed);
} else if constexpr (detail::is_optional<Type>::value) {
return el.has_value() ? 0U : hashing<typename Type::value_type>{}(*el);
return el.has_value() ? hashing<typename Type::value_type>{}(*el) : 0U;
} else {
static_assert(has_hash_v<Type> || std::is_scalar_v<Type> ||
has_std_hash_v<Type> || is_iterable_v<Type> ||
Expand Down

0 comments on commit f54b3ec

Please sign in to comment.