Приведенный ниже код, составленный MCVS, дает мне:
Error C3848 expression having type 'const _Hasher' would lose some const-volatile qualifiers
in order to call 'size_t TupleHash::operator ()(const std::tuple &)'
< /code>
Код: Выделить всё
struct TupleHash
{
// uncomment the const keyword below resolves the error
template
std::size_t operator()(const std::tuple &t) // const
{
return std::hash{}(std::get(t)) ^ (std::hash{}(std::get(t))
Подробнее здесь: [url]https://stackoverflow.com/questions/79673004/why-tuple-hash-function-itself-i-e-operator-needs-to-be-const[/url]