{"action":"created","comment":{"url":"https://api.github.com/repos/vespa-engine/vespa/pulls/comments/229286901","pull_request_review_id":169747638,"id":229286901,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTI4NjkwMQ==","diff_hunk":"@@ -50,6 +50,25 @@ class hash_map\n     void erase(const_iterator it)               { return erase(it->first); }\n     iterator find(const K & key)                { return _ht.find(key); }\n     const_iterator find(const K & key)    const { return _ht.find(key); }\n+\n+    template< typename AltKey, typename AltExtract=std::_Identity<K>, typename AltHash=vespalib::hash<AltKey>, typename AltEqual=equal_to<AltKey, K> >\n+    const_iterator find(const AltKey & key) const {","path":"vespalib/src/vespa/vespalib/stllike/hash_map.h","position":6,"original_position":6,"commit_id":"6aca49f2b7d72a7ed0f0b93e62f191ea9b7fb273","original_commit_id":"6aca49f2b7d72a7ed0f0b93e62f191ea9b7fb273","user":{"login":"vekterli","id":16582643,"node_id":"MDQ6VXNlcjE2NTgyNjQz","avatar_url":"https://avatars1.githubusercontent.com/u/16582643?v=4","gravatar_id":"","url":"https://api.github.com/users/vekterli","html_url":"https://github.com/vekterli","followers_url":"https://api.github.com/users/vekterli/followers","following_url":"https://api.github.com/users/vekterli/following{/other_user}","gists_url":"https://api.github.com/users/vekterli/gists{/gist_id}","starred_url":"https://api.github.com/users/vekterli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vekterli/subscriptions","organizations_url":"https://api.github.com/users/vekterli/orgs","repos_url":"https://api.github.com/users/vekterli/repos","events_url":"https://api.github.com/users/vekterli/events{/privacy}","received_events_url":"https://api.github.com/users/vekterli/received_events","type":"User","site_admin":false},"body":"Boost.MultiIndex also supports heterogenous lookups in a slightly different way by explicitly specifying hash and equality functors at `find()`-time: https://www.boost.org/doc/libs/1_68_0/libs/multi_index/doc/tutorial/indices.html#hash_lookup\r\n\r\nAgain the supported types must be specified directly to avoid type conversion issues.\r\n\r\nPersonally I'm leaning rather more towards the Working Group proposal above since it automatically works for all invocations of `find()` and only specifies the hashing/equality policy once.","created_at":"2018-10-30T12:33:25Z","updated_at":"2018-10-30T12:33:26Z","html_url":"https://github.com/vespa-engine/vespa/pull/7476#discussion_r229286901","pull_request_url":"https://api.github.com/repos/vespa-engine/vespa/pulls/7476","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/comments/229286901"},"html":{"href":"https://github.com/vespa-engine/vespa/pull/7476#discussion_r229286901"},"pull_request":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/7476"}},"in_reply_to_id":229244257},"pull_request":{"url":"https://api.github.com/repos/vespa-engine/vespa/pulls/7476","id":226519108,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NTE5MTA4","html_url":"https://github.com/vespa-engine/vespa/pull/7476","diff_url":"https://github.com/vespa-engine/vespa/pull/7476.diff","patch_url":"https://github.com/vespa-engine/vespa/pull/7476.patch","issue_url":"https://api.github.com/repos/vespa-engine/vespa/issues/7476","number":7476,"state":"open","locked":false,"title":"Use a templated find() to enable lookup without object creation when …","user":{"login":"baldersheim","id":19857788,"node_id":"MDQ6VXNlcjE5ODU3Nzg4","avatar_url":"https://avatars2.githubusercontent.com/u/19857788?v=4","gravatar_id":"","url":"https://api.github.com/users/baldersheim","html_url":"https://github.com/baldersheim","followers_url":"https://api.github.com/users/baldersheim/followers","following_url":"https://api.github.com/users/baldersheim/following{/other_user}","gists_url":"https://api.github.com/users/baldersheim/gists{/gist_id}","starred_url":"https://api.github.com/users/baldersheim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldersheim/subscriptions","organizations_url":"https://api.github.com/users/baldersheim/orgs","repos_url":"https://api.github.com/users/baldersheim/repos","events_url":"https://api.github.com/users/baldersheim/events{/privacy}","received_events_url":"https://api.github.com/users/baldersheim/received_events","type":"User","site_admin":false},"body":"…objects are comparable.","created_at":"2018-10-29T11:07:33Z","updated_at":"2018-10-30T12:33:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1c9687bd08a2eda483537d18a3a87b086ea8d6b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vespa-engine/vespa/pulls/7476/commits","review_comments_url":"https://api.github.com/repos/vespa-engine/vespa/pulls/7476/comments","review_comment_url":"https://api.github.com/repos/vespa-engine/vespa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vespa-engine/vespa/issues/7476/comments","statuses_url":"https://api.github.com/repos/vespa-engine/vespa/statuses/6aca49f2b7d72a7ed0f0b93e62f191ea9b7fb273","head":{"label":"vespa-engine:balder/use-templated-find","ref":"balder/use-templated-find","sha":"6aca49f2b7d72a7ed0f0b93e62f191ea9b7fb273","user":{"login":"vespa-engine","id":29299694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mjk5Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/29299694?v=4","gravatar_id":"","url":"https://api.github.com/users/vespa-engine","html_url":"https://github.com/vespa-engine","followers_url":"https://api.github.com/users/vespa-engine/followers","following_url":"https://api.github.com/users/vespa-engine/following{/other_user}","gists_url":"https://api.github.com/users/vespa-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/vespa-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vespa-engine/subscriptions","organizations_url":"https://api.github.com/users/vespa-engine/orgs","repos_url":"https://api.github.com/users/vespa-engine/repos","events_url":"https://api.github.com/users/vespa-engine/events{/privacy}","received_events_url":"https://api.github.com/users/vespa-engine/received_events","type":"Organization","site_admin":false},"repo":{"id":60377070,"node_id":"MDEwOlJlcG9zaXRvcnk2MDM3NzA3MA==","name":"vespa","full_name":"vespa-engine/vespa","private":false,"owner":{"login":"vespa-engine","id":29299694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mjk5Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/29299694?v=4","gravatar_id":"","url":"https://api.github.com/users/vespa-engine","html_url":"https://github.com/vespa-engine","followers_url":"https://api.github.com/users/vespa-engine/followers","following_url":"https://api.github.com/users/vespa-engine/following{/other_user}","gists_url":"https://api.github.com/users/vespa-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/vespa-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vespa-engine/subscriptions","organizations_url":"https://api.github.com/users/vespa-engine/orgs","repos_url":"https://api.github.com/users/vespa-engine/repos","events_url":"https://api.github.com/users/vespa-engine/events{/privacy}","received_events_url":"https://api.github.com/users/vespa-engine/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vespa-engine/vespa","description":"Vespa - the open big data serving engine","fork":false,"url":"https://api.github.com/repos/vespa-engine/vespa","forks_url":"https://api.github.com/repos/vespa-engine/vespa/forks","keys_url":"https://api.github.com/repos/vespa-engine/vespa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vespa-engine/vespa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vespa-engine/vespa/teams","hooks_url":"https://api.github.com/repos/vespa-engine/vespa/hooks","issue_events_url":"https://api.github.com/repos/vespa-engine/vespa/issues/events{/number}","events_url":"https://api.github.com/repos/vespa-engine/vespa/events","assignees_url":"https://api.github.com/repos/vespa-engine/vespa/assignees{/user}","branches_url":"https://api.github.com/repos/vespa-engine/vespa/branches{/branch}","tags_url":"https://api.github.com/repos/vespa-engine/vespa/tags","blobs_url":"https://api.github.com/repos/vespa-engine/vespa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vespa-engine/vespa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vespa-engine/vespa/git/refs{/sha}","trees_url":"https://api.github.com/repos/vespa-engine/vespa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vespa-engine/vespa/statuses/{sha}","languages_url":"https://api.github.com/repos/vespa-engine/vespa/languages","stargazers_url":"https://api.github.com/repos/vespa-engine/vespa/stargazers","contributors_url":"https://api.github.com/repos/vespa-engine/vespa/contributors","subscribers_url":"https://api.github.com/repos/vespa-engine/vespa/subscribers","subscription_url":"https://api.github.com/repos/vespa-engine/vespa/subscription","commits_url":"https://api.github.com/repos/vespa-engine/vespa/commits{/sha}","git_commits_url":"https://api.github.com/repos/vespa-engine/vespa/git/commits{/sha}","comments_url":"https://api.github.com/repos/vespa-engine/vespa/comments{/number}","issue_comment_url":"https://api.github.com/repos/vespa-engine/vespa/issues/comments{/number}","contents_url":"https://api.github.com/repos/vespa-engine/vespa/contents/{+path}","compare_url":"https://api.github.com/repos/vespa-engine/vespa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vespa-engine/vespa/merges","archive_url":"https://api.github.com/repos/vespa-engine/vespa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vespa-engine/vespa/downloads","issues_url":"https://api.github.com/repos/vespa-engine/vespa/issues{/number}","pulls_url":"https://api.github.com/repos/vespa-engine/vespa/pulls{/number}","milestones_url":"https://api.github.com/repos/vespa-engine/vespa/milestones{/number}","notifications_url":"https://api.github.com/repos/vespa-engine/vespa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vespa-engine/vespa/labels{/name}","releases_url":"https://api.github.com/repos/vespa-engine/vespa/releases{/id}","deployments_url":"https://api.github.com/repos/vespa-engine/vespa/deployments","created_at":"2016-06-03T20:54:20Z","updated_at":"2018-10-30T10:09:58Z","pushed_at":"2018-10-30T10:10:01Z","git_url":"git://github.com/vespa-engine/vespa.git","ssh_url":"git@github.com:vespa-engine/vespa.git","clone_url":"https://github.com/vespa-engine/vespa.git","svn_url":"https://github.com/vespa-engine/vespa","homepage":"http://vespa.ai/","size":81382,"stargazers_count":2627,"watchers_count":2627,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":311,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":311,"open_issues":55,"watchers":2627,"default_branch":"master"}},"base":{"label":"vespa-engine:master","ref":"master","sha":"c94b13a6c215cc5c89230b47005157038e27bc7b","user":{"login":"vespa-engine","id":29299694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mjk5Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/29299694?v=4","gravatar_id":"","url":"https://api.github.com/users/vespa-engine","html_url":"https://github.com/vespa-engine","followers_url":"https://api.github.com/users/vespa-engine/followers","following_url":"https://api.github.com/users/vespa-engine/following{/other_user}","gists_url":"https://api.github.com/users/vespa-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/vespa-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vespa-engine/subscriptions","organizations_url":"https://api.github.com/users/vespa-engine/orgs","repos_url":"https://api.github.com/users/vespa-engine/repos","events_url":"https://api.github.com/users/vespa-engine/events{/privacy}","received_events_url":"https://api.github.com/users/vespa-engine/received_events","type":"Organization","site_admin":false},"repo":{"id":60377070,"node_id":"MDEwOlJlcG9zaXRvcnk2MDM3NzA3MA==","name":"vespa","full_name":"vespa-engine/vespa","private":false,"owner":{"login":"vespa-engine","id":29299694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mjk5Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/29299694?v=4","gravatar_id":"","url":"https://api.github.com/users/vespa-engine","html_url":"https://github.com/vespa-engine","followers_url":"https://api.github.com/users/vespa-engine/followers","following_url":"https://api.github.com/users/vespa-engine/following{/other_user}","gists_url":"https://api.github.com/users/vespa-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/vespa-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vespa-engine/subscriptions","organizations_url":"https://api.github.com/users/vespa-engine/orgs","repos_url":"https://api.github.com/users/vespa-engine/repos","events_url":"https://api.github.com/users/vespa-engine/events{/privacy}","received_events_url":"https://api.github.com/users/vespa-engine/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vespa-engine/vespa","description":"Vespa - the open big data serving engine","fork":false,"url":"https://api.github.com/repos/vespa-engine/vespa","forks_url":"https://api.github.com/repos/vespa-engine/vespa/forks","keys_url":"https://api.github.com/repos/vespa-engine/vespa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vespa-engine/vespa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vespa-engine/vespa/teams","hooks_url":"https://api.github.com/repos/vespa-engine/vespa/hooks","issue_events_url":"https://api.github.com/repos/vespa-engine/vespa/issues/events{/number}","events_url":"https://api.github.com/repos/vespa-engine/vespa/events","assignees_url":"https://api.github.com/repos/vespa-engine/vespa/assignees{/user}","branches_url":"https://api.github.com/repos/vespa-engine/vespa/branches{/branch}","tags_url":"https://api.github.com/repos/vespa-engine/vespa/tags","blobs_url":"https://api.github.com/repos/vespa-engine/vespa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vespa-engine/vespa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vespa-engine/vespa/git/refs{/sha}","trees_url":"https://api.github.com/repos/vespa-engine/vespa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vespa-engine/vespa/statuses/{sha}","languages_url":"https://api.github.com/repos/vespa-engine/vespa/languages","stargazers_url":"https://api.github.com/repos/vespa-engine/vespa/stargazers","contributors_url":"https://api.github.com/repos/vespa-engine/vespa/contributors","subscribers_url":"https://api.github.com/repos/vespa-engine/vespa/subscribers","subscription_url":"https://api.github.com/repos/vespa-engine/vespa/subscription","commits_url":"https://api.github.com/repos/vespa-engine/vespa/commits{/sha}","git_commits_url":"https://api.github.com/repos/vespa-engine/vespa/git/commits{/sha}","comments_url":"https://api.github.com/repos/vespa-engine/vespa/comments{/number}","issue_comment_url":"https://api.github.com/repos/vespa-engine/vespa/issues/comments{/number}","contents_url":"https://api.github.com/repos/vespa-engine/vespa/contents/{+path}","compare_url":"https://api.github.com/repos/vespa-engine/vespa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vespa-engine/vespa/merges","archive_url":"https://api.github.com/repos/vespa-engine/vespa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vespa-engine/vespa/downloads","issues_url":"https://api.github.com/repos/vespa-engine/vespa/issues{/number}","pulls_url":"https://api.github.com/repos/vespa-engine/vespa/pulls{/number}","milestones_url":"https://api.github.com/repos/vespa-engine/vespa/milestones{/number}","notifications_url":"https://api.github.com/repos/vespa-engine/vespa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vespa-engine/vespa/labels{/name}","releases_url":"https://api.github.com/repos/vespa-engine/vespa/releases{/id}","deployments_url":"https://api.github.com/repos/vespa-engine/vespa/deployments","created_at":"2016-06-03T20:54:20Z","updated_at":"2018-10-30T10:09:58Z","pushed_at":"2018-10-30T10:10:01Z","git_url":"git://github.com/vespa-engine/vespa.git","ssh_url":"git@github.com:vespa-engine/vespa.git","clone_url":"https://github.com/vespa-engine/vespa.git","svn_url":"https://github.com/vespa-engine/vespa","homepage":"http://vespa.ai/","size":81382,"stargazers_count":2627,"watchers_count":2627,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":311,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":311,"open_issues":55,"watchers":2627,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/7476"},"html":{"href":"https://github.com/vespa-engine/vespa/pull/7476"},"issue":{"href":"https://api.github.com/repos/vespa-engine/vespa/issues/7476"},"comments":{"href":"https://api.github.com/repos/vespa-engine/vespa/issues/7476/comments"},"review_comments":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/7476/comments"},"review_comment":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/7476/commits"},"statuses":{"href":"https://api.github.com/repos/vespa-engine/vespa/statuses/6aca49f2b7d72a7ed0f0b93e62f191ea9b7fb273"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vekterli"}}