Skip to content

Add support for templated keys for various operations#162

Open
xroche wants to merge 1 commit intosparsehash:masterfrom
xroche:feat/templated-key-for-find-count-equal_range
Open

Add support for templated keys for various operations#162
xroche wants to merge 1 commit intosparsehash:masterfrom
xroche:feat/templated-key-for-find-count-equal_range

Conversation

@xroche
Copy link

@xroche xroche commented Aug 19, 2021

This includes find, count, equal_range

The rationale is that HashFcn and EqualKey passed during type
construction may be tuned to support more types compared by the fixed
type key_type.

  • HashFcn would typically implement additional size_t operator()(const T& key) const member(s)
  • EqualKey would typically implement additional bool operator()(const T& other, const key_type& value) const member(s)

Code tested and validated in our codebase (https://github.com/algolia)

@xroche xroche force-pushed the feat/templated-key-for-find-count-equal_range branch from de0d995 to aff25f9 Compare August 19, 2021 15:37
This includes `find`, `count`, `equal_range`

The rationale is that `HashFcn` and `EqualKey` passed during type
construction may be tuned to support more types compared by the fixed
type `key_type`.

* `HashFcn` would typically implement additional `size_t operator()(const T& key) const` member(s)
* `EqualKey` would typically implement additional `bool operator()(const T& other, const key_type& value) const` member(s)
@xroche xroche force-pushed the feat/templated-key-for-find-count-equal_range branch from aff25f9 to 30a408e Compare August 19, 2021 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant