{"action":"created","comment":{"url":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/comments/55656793","id":55656793,"diff_hunk":"@@ -44,11 +42,36 @@\n \n namespace cppsort\n {\n-    ////////////////////////////////////////////////////////////\n-    // Adapter\n-\n     namespace detail\n     {\n+        ////////////////////////////////////////////////////////////\n+        // Dedicated comparison function\n+\n+        template<typename Compare>\n+        class schwartz_compare\n+        {\n+            private:\n+\n+                Compare compare;\n+\n+            public:\n+\n+                explicit schwartz_compare(Compare compare):\n+                    compare(compare)\n+                {}\n+\n+                template<typename T, typename U>\n+                auto operator()(T&& lhs, U&& rhs)\n+                    noexcept(noexcept(compare(std::forward<T>(lhs).data, std::forward<U>(rhs).data)))\n+                    -> decltype(compare(std::forward<T>(lhs).data, std::forward<U>(rhs).data))","path":"include/cpp-sort/adapters/schwartz_adapter.h","position":41,"original_position":41,"commit_id":"caae742f0b81112a99b3e1b946c93a72a0dd1404","original_commit_id":"caae742f0b81112a99b3e1b946c93a72a0dd1404","user":{"login":"vendethiel","id":199499,"avatar_url":"https://avatars.githubusercontent.com/u/199499?v=3","gravatar_id":"","url":"https://api.github.com/users/vendethiel","html_url":"https://github.com/vendethiel","followers_url":"https://api.github.com/users/vendethiel/followers","following_url":"https://api.github.com/users/vendethiel/following{/other_user}","gists_url":"https://api.github.com/users/vendethiel/gists{/gist_id}","starred_url":"https://api.github.com/users/vendethiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vendethiel/subscriptions","organizations_url":"https://api.github.com/users/vendethiel/orgs","repos_url":"https://api.github.com/users/vendethiel/repos","events_url":"https://api.github.com/users/vendethiel/events{/privacy}","received_events_url":"https://api.github.com/users/vendethiel/received_events","type":"User","site_admin":false},"body":"I'm sure that could be a macro. **kof**","created_at":"2016-03-10T09:59:58Z","updated_at":"2016-03-10T09:59:58Z","html_url":"https://github.com/Morwenn/cpp-sort/pull/60#discussion_r55656793","pull_request_url":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/comments/55656793"},"html":{"href":"https://github.com/Morwenn/cpp-sort/pull/60#discussion_r55656793"},"pull_request":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/60","id":62323719,"html_url":"https://github.com/Morwenn/cpp-sort/pull/60","diff_url":"https://github.com/Morwenn/cpp-sort/pull/60.diff","patch_url":"https://github.com/Morwenn/cpp-sort/pull/60.patch","issue_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/60","number":60,"state":"closed","locked":false,"title":"Add a stable_adapter to the library. Fixes #21.","user":{"login":"Morwenn","id":1164683,"avatar_url":"https://avatars.githubusercontent.com/u/1164683?v=3","gravatar_id":"","url":"https://api.github.com/users/Morwenn","html_url":"https://github.com/Morwenn","followers_url":"https://api.github.com/users/Morwenn/followers","following_url":"https://api.github.com/users/Morwenn/following{/other_user}","gists_url":"https://api.github.com/users/Morwenn/gists{/gist_id}","starred_url":"https://api.github.com/users/Morwenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morwenn/subscriptions","organizations_url":"https://api.github.com/users/Morwenn/orgs","repos_url":"https://api.github.com/users/Morwenn/repos","events_url":"https://api.github.com/users/Morwenn/events{/privacy}","received_events_url":"https://api.github.com/users/Morwenn/received_events","type":"User","site_admin":false},"body":"Add a `stable_adapter` to the library, which can be used to obtain a stable sorter from any sorter:\r\n* Generalize `association`, `associated_value` and `associate_iterator` so that they can handle any associated data, and not only projections. Add a `get` method to `association` and `associated_value` to have uniform access to the underlying value, be it through the iterator or directly. Also add an `operator=(association&&)` to `association` and fix a related bug in `inplace_merge`.\r\n* Rename `association_compare` to `schwartz_compare` and more it to the appropriate header.\r\n* Add a `<cpp-sort/fwd.h>` with forward declarations of the library's main components.\r\n* Use actual `struct`s to implement `default_sorter` and `spread_sorter` so that they can be forward declared.\r\n* Add the high-level `stable_adapter`, but also `make_stable` to expose the underlying mechanism.\r\n* Get rid of `std_stable_sorter`, replace it with `stable_adapter<std_sorter>`.\r\n* Remove `merge_sorter` from the definition of `default_sorter`, introduce `stable_adapter<default_sorter>` instead.","created_at":"2016-03-10T01:03:25Z","updated_at":"2016-03-10T09:59:58Z","closed_at":"2016-03-10T01:12:31Z","merged_at":"2016-03-10T01:12:31Z","merge_commit_sha":"22ae40d432a3212fc92fc55307772d3403cfa593","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/60/commits","review_comments_url":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/60/comments","review_comment_url":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/60/comments","statuses_url":"https://api.github.com/repos/Morwenn/cpp-sort/statuses/caae742f0b81112a99b3e1b946c93a72a0dd1404","head":{"label":"Morwenn:stable_adapter","ref":"stable_adapter","sha":"caae742f0b81112a99b3e1b946c93a72a0dd1404","user":{"login":"Morwenn","id":1164683,"avatar_url":"https://avatars.githubusercontent.com/u/1164683?v=3","gravatar_id":"","url":"https://api.github.com/users/Morwenn","html_url":"https://github.com/Morwenn","followers_url":"https://api.github.com/users/Morwenn/followers","following_url":"https://api.github.com/users/Morwenn/following{/other_user}","gists_url":"https://api.github.com/users/Morwenn/gists{/gist_id}","starred_url":"https://api.github.com/users/Morwenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morwenn/subscriptions","organizations_url":"https://api.github.com/users/Morwenn/orgs","repos_url":"https://api.github.com/users/Morwenn/repos","events_url":"https://api.github.com/users/Morwenn/events{/privacy}","received_events_url":"https://api.github.com/users/Morwenn/received_events","type":"User","site_admin":false},"repo":{"id":40045203,"name":"cpp-sort","full_name":"Morwenn/cpp-sort","owner":{"login":"Morwenn","id":1164683,"avatar_url":"https://avatars.githubusercontent.com/u/1164683?v=3","gravatar_id":"","url":"https://api.github.com/users/Morwenn","html_url":"https://github.com/Morwenn","followers_url":"https://api.github.com/users/Morwenn/followers","following_url":"https://api.github.com/users/Morwenn/following{/other_user}","gists_url":"https://api.github.com/users/Morwenn/gists{/gist_id}","starred_url":"https://api.github.com/users/Morwenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morwenn/subscriptions","organizations_url":"https://api.github.com/users/Morwenn/orgs","repos_url":"https://api.github.com/users/Morwenn/repos","events_url":"https://api.github.com/users/Morwenn/events{/privacy}","received_events_url":"https://api.github.com/users/Morwenn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Morwenn/cpp-sort","description":"Additional sorting algorithms for C++14","fork":false,"url":"https://api.github.com/repos/Morwenn/cpp-sort","forks_url":"https://api.github.com/repos/Morwenn/cpp-sort/forks","keys_url":"https://api.github.com/repos/Morwenn/cpp-sort/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Morwenn/cpp-sort/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Morwenn/cpp-sort/teams","hooks_url":"https://api.github.com/repos/Morwenn/cpp-sort/hooks","issue_events_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/events{/number}","events_url":"https://api.github.com/repos/Morwenn/cpp-sort/events","assignees_url":"https://api.github.com/repos/Morwenn/cpp-sort/assignees{/user}","branches_url":"https://api.github.com/repos/Morwenn/cpp-sort/branches{/branch}","tags_url":"https://api.github.com/repos/Morwenn/cpp-sort/tags","blobs_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/refs{/sha}","trees_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Morwenn/cpp-sort/statuses/{sha}","languages_url":"https://api.github.com/repos/Morwenn/cpp-sort/languages","stargazers_url":"https://api.github.com/repos/Morwenn/cpp-sort/stargazers","contributors_url":"https://api.github.com/repos/Morwenn/cpp-sort/contributors","subscribers_url":"https://api.github.com/repos/Morwenn/cpp-sort/subscribers","subscription_url":"https://api.github.com/repos/Morwenn/cpp-sort/subscription","commits_url":"https://api.github.com/repos/Morwenn/cpp-sort/commits{/sha}","git_commits_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/commits{/sha}","comments_url":"https://api.github.com/repos/Morwenn/cpp-sort/comments{/number}","issue_comment_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/comments{/number}","contents_url":"https://api.github.com/repos/Morwenn/cpp-sort/contents/{+path}","compare_url":"https://api.github.com/repos/Morwenn/cpp-sort/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Morwenn/cpp-sort/merges","archive_url":"https://api.github.com/repos/Morwenn/cpp-sort/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Morwenn/cpp-sort/downloads","issues_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues{/number}","pulls_url":"https://api.github.com/repos/Morwenn/cpp-sort/pulls{/number}","milestones_url":"https://api.github.com/repos/Morwenn/cpp-sort/milestones{/number}","notifications_url":"https://api.github.com/repos/Morwenn/cpp-sort/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Morwenn/cpp-sort/labels{/name}","releases_url":"https://api.github.com/repos/Morwenn/cpp-sort/releases{/id}","deployments_url":"https://api.github.com/repos/Morwenn/cpp-sort/deployments","created_at":"2015-08-01T11:58:35Z","updated_at":"2016-03-09T12:17:40Z","pushed_at":"2016-03-10T01:12:31Z","git_url":"git://github.com/Morwenn/cpp-sort.git","ssh_url":"git@github.com:Morwenn/cpp-sort.git","clone_url":"https://github.com/Morwenn/cpp-sort.git","svn_url":"https://github.com/Morwenn/cpp-sort","homepage":"","size":1066,"stargazers_count":73,"watchers_count":73,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":18,"forks":2,"open_issues":18,"watchers":73,"default_branch":"master"}},"base":{"label":"Morwenn:master","ref":"master","sha":"ed232af5a9094e53aa52fe9c1611703f04998ff7","user":{"login":"Morwenn","id":1164683,"avatar_url":"https://avatars.githubusercontent.com/u/1164683?v=3","gravatar_id":"","url":"https://api.github.com/users/Morwenn","html_url":"https://github.com/Morwenn","followers_url":"https://api.github.com/users/Morwenn/followers","following_url":"https://api.github.com/users/Morwenn/following{/other_user}","gists_url":"https://api.github.com/users/Morwenn/gists{/gist_id}","starred_url":"https://api.github.com/users/Morwenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morwenn/subscriptions","organizations_url":"https://api.github.com/users/Morwenn/orgs","repos_url":"https://api.github.com/users/Morwenn/repos","events_url":"https://api.github.com/users/Morwenn/events{/privacy}","received_events_url":"https://api.github.com/users/Morwenn/received_events","type":"User","site_admin":false},"repo":{"id":40045203,"name":"cpp-sort","full_name":"Morwenn/cpp-sort","owner":{"login":"Morwenn","id":1164683,"avatar_url":"https://avatars.githubusercontent.com/u/1164683?v=3","gravatar_id":"","url":"https://api.github.com/users/Morwenn","html_url":"https://github.com/Morwenn","followers_url":"https://api.github.com/users/Morwenn/followers","following_url":"https://api.github.com/users/Morwenn/following{/other_user}","gists_url":"https://api.github.com/users/Morwenn/gists{/gist_id}","starred_url":"https://api.github.com/users/Morwenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morwenn/subscriptions","organizations_url":"https://api.github.com/users/Morwenn/orgs","repos_url":"https://api.github.com/users/Morwenn/repos","events_url":"https://api.github.com/users/Morwenn/events{/privacy}","received_events_url":"https://api.github.com/users/Morwenn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Morwenn/cpp-sort","description":"Additional sorting algorithms for C++14","fork":false,"url":"https://api.github.com/repos/Morwenn/cpp-sort","forks_url":"https://api.github.com/repos/Morwenn/cpp-sort/forks","keys_url":"https://api.github.com/repos/Morwenn/cpp-sort/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Morwenn/cpp-sort/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Morwenn/cpp-sort/teams","hooks_url":"https://api.github.com/repos/Morwenn/cpp-sort/hooks","issue_events_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/events{/number}","events_url":"https://api.github.com/repos/Morwenn/cpp-sort/events","assignees_url":"https://api.github.com/repos/Morwenn/cpp-sort/assignees{/user}","branches_url":"https://api.github.com/repos/Morwenn/cpp-sort/branches{/branch}","tags_url":"https://api.github.com/repos/Morwenn/cpp-sort/tags","blobs_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/refs{/sha}","trees_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Morwenn/cpp-sort/statuses/{sha}","languages_url":"https://api.github.com/repos/Morwenn/cpp-sort/languages","stargazers_url":"https://api.github.com/repos/Morwenn/cpp-sort/stargazers","contributors_url":"https://api.github.com/repos/Morwenn/cpp-sort/contributors","subscribers_url":"https://api.github.com/repos/Morwenn/cpp-sort/subscribers","subscription_url":"https://api.github.com/repos/Morwenn/cpp-sort/subscription","commits_url":"https://api.github.com/repos/Morwenn/cpp-sort/commits{/sha}","git_commits_url":"https://api.github.com/repos/Morwenn/cpp-sort/git/commits{/sha}","comments_url":"https://api.github.com/repos/Morwenn/cpp-sort/comments{/number}","issue_comment_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues/comments{/number}","contents_url":"https://api.github.com/repos/Morwenn/cpp-sort/contents/{+path}","compare_url":"https://api.github.com/repos/Morwenn/cpp-sort/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Morwenn/cpp-sort/merges","archive_url":"https://api.github.com/repos/Morwenn/cpp-sort/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Morwenn/cpp-sort/downloads","issues_url":"https://api.github.com/repos/Morwenn/cpp-sort/issues{/number}","pulls_url":"https://api.github.com/repos/Morwenn/cpp-sort/pulls{/number}","milestones_url":"https://api.github.com/repos/Morwenn/cpp-sort/milestones{/number}","notifications_url":"https://api.github.com/repos/Morwenn/cpp-sort/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Morwenn/cpp-sort/labels{/name}","releases_url":"https://api.github.com/repos/Morwenn/cpp-sort/releases{/id}","deployments_url":"https://api.github.com/repos/Morwenn/cpp-sort/deployments","created_at":"2015-08-01T11:58:35Z","updated_at":"2016-03-09T12:17:40Z","pushed_at":"2016-03-10T01:12:31Z","git_url":"git://github.com/Morwenn/cpp-sort.git","ssh_url":"git@github.com:Morwenn/cpp-sort.git","clone_url":"https://github.com/Morwenn/cpp-sort.git","svn_url":"https://github.com/Morwenn/cpp-sort","homepage":"","size":1066,"stargazers_count":73,"watchers_count":73,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":18,"forks":2,"open_issues":18,"watchers":73,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/60"},"html":{"href":"https://github.com/Morwenn/cpp-sort/pull/60"},"issue":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/issues/60"},"comments":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/Morwenn/cpp-sort/statuses/caae742f0b81112a99b3e1b946c93a72a0dd1404"}}}}