Skip to content

[FR] Mutable access to stateful hashers and comparators #233

Description

@psiha

(like the implementation table_core class template provides)
I have an exotic use case where the state of the two subject objects references an external 'master' object which can potentially get moved around in memory/has an unstable reference (say as if stored in a std::vector) yet when I need to use the unordered container in question I know for certain that the 'master' object is 'pinned' - and would like to simply then update the reference stored in the hasher...

Yes - this opens up the can of worms of enabling the user the change the hasher in such a way that it potentially changes the hashes it returns - but this is already possible just not as easily (exactly by storing references in hashers) - so simply demand that hashes and comparators be [[ gnu::const ]] or else UB...?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions