mirror of
https://github.com/boostorg/container_hash.git
synced 2026-08-03 20:24:15 +02:00
Do not throw an exception when hashing valueless std::variant values
This commit is contained in:
@@ -455,7 +455,11 @@ namespace boost
|
|||||||
std::size_t seed = 0;
|
std::size_t seed = 0;
|
||||||
|
|
||||||
hash_combine( seed, v.index() );
|
hash_combine( seed, v.index() );
|
||||||
std::visit( [&seed](auto&& x) { hash_combine(seed, x); }, v );
|
|
||||||
|
if( !v.valueless_by_exception() )
|
||||||
|
{
|
||||||
|
std::visit( [&seed](auto&& x) { hash_combine(seed, x); }, v );
|
||||||
|
}
|
||||||
|
|
||||||
return seed;
|
return seed;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user