https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86433

            Bug ID: 86433
           Summary: Shouldn't non const hashers also be allowed?
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tiagomacarios at gmail dot com
  Target Milestone: ---

https://godbolt.org/g/Z1cqm9

#include <unordered_set>

struct my_hash {
    std::size_t operator() (int const&) /*const*/ {
        return {};                   // ~~~~~~~~~
    }
};

std::unordered_set<int, my_hash> temp;

Shouldn't non-const hashers also be allowed?

http://eel.is/c++draft/hash.requirements#2

Reply via email to