Код: Выделить всё
#include
#include
struct S {
struct Hasher_Cmper {
using is_transparent = int;
/* Hash */
auto operator()(const auto& s) const noexcept {
return std::hash{}(std::string{s});
}
/* KeyEqual */
bool operator()(const auto& a, const auto& b) const noexcept {
return std::string{a} == std::string{b};
}
};
std::unordered_set set;
void test() {
this->set.emplace("123");
}
};
int main() {}
Код: Выделить всё
static assertion failed: hash function must \
be invocable with an argument of key type:
static_assert(
__is_invocable{}, ...
Код: Выделить всё
g++Подробнее здесь: https://stackoverflow.com/questions/793 ... recognized
Мобильная версия