От: | rg45 | ||
Дата: | 31.07.21 11:17 | ||
Оценка: |
A>struct pivot_entry
A>{
A> uint32_t nCnt;
A> double fSum;
A> double fPart;
A>};
A>using pivot_key = std::tuple<std::wstring, std::wstring, std::wstring, std::wstring>;
A>using pivot_map = std::unordered_map<pivot_key, pivot_entry>;
A>
A>вилимо нужен оператор расчета хэша для pivot_key, а как его правильно сделать не подскажете?A>Error C2280 'std::_Uhash_compare<_Kty,_Hasher,_Keyeq>::_Uhash_compare(const std::_Uhash_compare<_Kty,_Hasher,_Keyeq> &)': attempting to reference a deleted function
using pivot_map_key = std::tuple<std::wstring, std::wstring, std::wstring, std::wstring>;
struct pivot_map_hash
{
size_t operator()(const pivot_map_key& key) const
{
using str_hash = std::hash<std::wstring>;
return
str_hash()(std::get<0>(key)) ^
(str_hash()(std::get<1>(key)) << 1) ^
(str_hash()(std::get<2>(key)) << 2) ^
(str_hash()(std::get<3>(key)) << 3);
}
};
using pivot_map = std::unordered_map<pivot_map_key, pivot_entry, pivot_map_hash>;