今天同事把一個map replace成unordered_map,因為沒有排序的需求,結果就遇到static assertion
static_assert(__check_hash_requirements<_Key, _Hash>::value,
"the specified hash does not meet the Hash requirements");
我好奇點進去看這個 __check_hash_requirements 到底幹了什麼好事
template <class _Key, class _Hash>
using __check_hash_requirements = integral_constant<bool,
is_copy_constructible<_Hash>::value &&
Vincent Lee changed 5 years agoView mode Like 2 Bookmark