{"action":"opened","number":1498,"pull_request":{"url":"https://api.github.com/repos/nanocurrency/raiblocks/pulls/1498","id":240690679,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwNjkwNjc5","html_url":"https://github.com/nanocurrency/raiblocks/pull/1498","diff_url":"https://github.com/nanocurrency/raiblocks/pull/1498.diff","patch_url":"https://github.com/nanocurrency/raiblocks/pull/1498.patch","issue_url":"https://api.github.com/repos/nanocurrency/raiblocks/issues/1498","number":1498,"state":"open","locked":false,"title":"Replace bind with lambda","user":{"login":"wezrule","id":650038,"node_id":"MDQ6VXNlcjY1MDAzOA==","avatar_url":"https://avatars0.githubusercontent.com/u/650038?v=4","gravatar_id":"","url":"https://api.github.com/users/wezrule","html_url":"https://github.com/wezrule","followers_url":"https://api.github.com/users/wezrule/followers","following_url":"https://api.github.com/users/wezrule/following{/other_user}","gists_url":"https://api.github.com/users/wezrule/gists{/gist_id}","starred_url":"https://api.github.com/users/wezrule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wezrule/subscriptions","organizations_url":"https://api.github.com/users/wezrule/orgs","repos_url":"https://api.github.com/users/wezrule/repos","events_url":"https://api.github.com/users/wezrule/events{/privacy}","received_events_url":"https://api.github.com/users/wezrule/received_events","type":"User","site_admin":false},"body":"I propose to replace all binds with lambdas. As of C++14 there isn't anything that std::bind does which lambdas can't do (that I know of). Lambdas are actually used throughout the code except notably in rai_secure.cpp. In addition to removing this construct entirely from the codebase, it keeps the asio callbacks more consistent.\r\n\r\nAs \"Effective Modern C++ Item 34 - Prefer lambdas to std::bind\" describes, to the uninitiated _1 essentially looks like magic (among other things). std::bind1st and std::bind2nd have been removed in C++17, and std::bind is set to follow suit. For more information about std::bind there is a handy section of this video by [Stephan T Lavavej](https://youtu.be/zt7ThwVfap0?t=1511):","created_at":"2018-12-23T16:41:01Z","updated_at":"2018-12-23T16:41:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nanocurrency/raiblocks/pulls/1498/commits","review_comments_url":"https://api.github.com/repos/nanocurrency/raiblocks/pulls/1498/comments","review_comment_url":"https://api.github.com/repos/nanocurrency/raiblocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nanocurrency/raiblocks/issues/1498/comments","statuses_url":"https://api.github.com/repos/nanocurrency/raiblocks/statuses/74763ccf20951dbb88347d8643bbf11195d5c9b8","head":{"label":"wezrule:replace_bind_with_lambda","ref":"replace_bind_with_lambda","sha":"74763ccf20951dbb88347d8643bbf11195d5c9b8","user":{"login":"wezrule","id":650038,"node_id":"MDQ6VXNlcjY1MDAzOA==","avatar_url":"https://avatars0.githubusercontent.com/u/650038?v=4","gravatar_id":"","url":"https://api.github.com/users/wezrule","html_url":"https://github.com/wezrule","followers_url":"https://api.github.com/users/wezrule/followers","following_url":"https://api.github.com/users/wezrule/following{/other_user}","gists_url":"https://api.github.com/users/wezrule/gists{/gist_id}","starred_url":"https://api.github.com/users/wezrule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wezrule/subscriptions","organizations_url":"https://api.github.com/users/wezrule/orgs","repos_url":"https://api.github.com/users/wezrule/repos","events_url":"https://api.github.com/users/wezrule/events{/privacy}","received_events_url":"https://api.github.com/users/wezrule/received_events","type":"User","site_admin":false},"repo":{"id":161826638,"node_id":"MDEwOlJlcG9zaXRvcnkxNjE4MjY2Mzg=","name":"raiblocks","full_name":"wezrule/raiblocks","private":false,"owner":{"login":"wezrule","id":650038,"node_id":"MDQ6VXNlcjY1MDAzOA==","avatar_url":"https://avatars0.githubusercontent.com/u/650038?v=4","gravatar_id":"","url":"https://api.github.com/users/wezrule","html_url":"https://github.com/wezrule","followers_url":"https://api.github.com/users/wezrule/followers","following_url":"https://api.github.com/users/wezrule/following{/other_user}","gists_url":"https://api.github.com/users/wezrule/gists{/gist_id}","starred_url":"https://api.github.com/users/wezrule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wezrule/subscriptions","organizations_url":"https://api.github.com/users/wezrule/orgs","repos_url":"https://api.github.com/users/wezrule/repos","events_url":"https://api.github.com/users/wezrule/events{/privacy}","received_events_url":"https://api.github.com/users/wezrule/received_events","type":"User","site_admin":false},"html_url":"https://github.com/wezrule/raiblocks","description":"Nano is a cryptocurrency","fork":true,"url":"https://api.github.com/repos/wezrule/raiblocks","forks_url":"https://api.github.com/repos/wezrule/raiblocks/forks","keys_url":"https://api.github.com/repos/wezrule/raiblocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wezrule/raiblocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wezrule/raiblocks/teams","hooks_url":"https://api.github.com/repos/wezrule/raiblocks/hooks","issue_events_url":"https://api.github.com/repos/wezrule/raiblocks/issues/events{/number}","events_url":"https://api.github.com/repos/wezrule/raiblocks/events","assignees_url":"https://api.github.com/repos/wezrule/raiblocks/assignees{/user}","branches_url":"https://api.github.com/repos/wezrule/raiblocks/branches{/branch}","tags_url":"https://api.github.com/repos/wezrule/raiblocks/tags","blobs_url":"https://api.github.com/repos/wezrule/raiblocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wezrule/raiblocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wezrule/raiblocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/wezrule/raiblocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wezrule/raiblocks/statuses/{sha}","languages_url":"https://api.github.com/repos/wezrule/raiblocks/languages","stargazers_url":"https://api.github.com/repos/wezrule/raiblocks/stargazers","contributors_url":"https://api.github.com/repos/wezrule/raiblocks/contributors","subscribers_url":"https://api.github.com/repos/wezrule/raiblocks/subscribers","subscription_url":"https://api.github.com/repos/wezrule/raiblocks/subscription","commits_url":"https://api.github.com/repos/wezrule/raiblocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/wezrule/raiblocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/wezrule/raiblocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/wezrule/raiblocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/wezrule/raiblocks/contents/{+path}","compare_url":"https://api.github.com/repos/wezrule/raiblocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wezrule/raiblocks/merges","archive_url":"https://api.github.com/repos/wezrule/raiblocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wezrule/raiblocks/downloads","issues_url":"https://api.github.com/repos/wezrule/raiblocks/issues{/number}","pulls_url":"https://api.github.com/repos/wezrule/raiblocks/pulls{/number}","milestones_url":"https://api.github.com/repos/wezrule/raiblocks/milestones{/number}","notifications_url":"https://api.github.com/repos/wezrule/raiblocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wezrule/raiblocks/labels{/name}","releases_url":"https://api.github.com/repos/wezrule/raiblocks/releases{/id}","deployments_url":"https://api.github.com/repos/wezrule/raiblocks/deployments","created_at":"2018-12-14T18:41:25Z","updated_at":"2018-12-23T13:05:40Z","pushed_at":"2018-12-23T15:48:08Z","git_url":"git://github.com/wezrule/raiblocks.git","ssh_url":"git@github.com:wezrule/raiblocks.git","clone_url":"https://github.com/wezrule/raiblocks.git","svn_url":"https://github.com/wezrule/raiblocks","homepage":"https://nano.org","size":16091,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nanocurrency:master","ref":"master","sha":"c230110fba60722fa2f6fb114dfc2af125f4a9de","user":{"login":"nanocurrency","id":34106716,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MTA2NzE2","avatar_url":"https://avatars0.githubusercontent.com/u/34106716?v=4","gravatar_id":"","url":"https://api.github.com/users/nanocurrency","html_url":"https://github.com/nanocurrency","followers_url":"https://api.github.com/users/nanocurrency/followers","following_url":"https://api.github.com/users/nanocurrency/following{/other_user}","gists_url":"https://api.github.com/users/nanocurrency/gists{/gist_id}","starred_url":"https://api.github.com/users/nanocurrency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanocurrency/subscriptions","organizations_url":"https://api.github.com/users/nanocurrency/orgs","repos_url":"https://api.github.com/users/nanocurrency/repos","events_url":"https://api.github.com/users/nanocurrency/events{/privacy}","received_events_url":"https://api.github.com/users/nanocurrency/received_events","type":"Organization","site_admin":false},"repo":{"id":19347340,"node_id":"MDEwOlJlcG9zaXRvcnkxOTM0NzM0MA==","name":"raiblocks","full_name":"nanocurrency/raiblocks","private":false,"owner":{"login":"nanocurrency","id":34106716,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MTA2NzE2","avatar_url":"https://avatars0.githubusercontent.com/u/34106716?v=4","gravatar_id":"","url":"https://api.github.com/users/nanocurrency","html_url":"https://github.com/nanocurrency","followers_url":"https://api.github.com/users/nanocurrency/followers","following_url":"https://api.github.com/users/nanocurrency/following{/other_user}","gists_url":"https://api.github.com/users/nanocurrency/gists{/gist_id}","starred_url":"https://api.github.com/users/nanocurrency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanocurrency/subscriptions","organizations_url":"https://api.github.com/users/nanocurrency/orgs","repos_url":"https://api.github.com/users/nanocurrency/repos","events_url":"https://api.github.com/users/nanocurrency/events{/privacy}","received_events_url":"https://api.github.com/users/nanocurrency/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nanocurrency/raiblocks","description":"Nano is a cryptocurrency","fork":false,"url":"https://api.github.com/repos/nanocurrency/raiblocks","forks_url":"https://api.github.com/repos/nanocurrency/raiblocks/forks","keys_url":"https://api.github.com/repos/nanocurrency/raiblocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nanocurrency/raiblocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nanocurrency/raiblocks/teams","hooks_url":"https://api.github.com/repos/nanocurrency/raiblocks/hooks","issue_events_url":"https://api.github.com/repos/nanocurrency/raiblocks/issues/events{/number}","events_url":"https://api.github.com/repos/nanocurrency/raiblocks/events","assignees_url":"https://api.github.com/repos/nanocurrency/raiblocks/assignees{/user}","branches_url":"https://api.github.com/repos/nanocurrency/raiblocks/branches{/branch}","tags_url":"https://api.github.com/repos/nanocurrency/raiblocks/tags","blobs_url":"https://api.github.com/repos/nanocurrency/raiblocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nanocurrency/raiblocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nanocurrency/raiblocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/nanocurrency/raiblocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nanocurrency/raiblocks/statuses/{sha}","languages_url":"https://api.github.com/repos/nanocurrency/raiblocks/languages","stargazers_url":"https://api.github.com/repos/nanocurrency/raiblocks/stargazers","contributors_url":"https://api.github.com/repos/nanocurrency/raiblocks/contributors","subscribers_url":"https://api.github.com/repos/nanocurrency/raiblocks/subscribers","subscription_url":"https://api.github.com/repos/nanocurrency/raiblocks/subscription","commits_url":"https://api.github.com/repos/nanocurrency/raiblocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/nanocurrency/raiblocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/nanocurrency/raiblocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/nanocurrency/raiblocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/nanocurrency/raiblocks/contents/{+path}","compare_url":"https://api.github.com/repos/nanocurrency/raiblocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nanocurrency/raiblocks/merges","archive_url":"https://api.github.com/repos/nanocurrency/raiblocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nanocurrency/raiblocks/downloads","issues_url":"https://api.github.com/repos/nanocurrency/raiblocks/issues{/number}","pulls_url":"https://api.github.com/repos/nanocurrency/raiblocks/pulls{/number}","milestones_url":"https://api.github.com/repos/nanocurrency/raiblocks/milestones{/number}","notifications_url":"https://api.github.com/repos/nanocurrency/raiblocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nanocurrency/raiblocks/labels{/name}","releases_url":"https://api.github.com/repos/nanocurrency/raiblocks/releases{/id}","deployments_url":"https://api.github.com/repos/nanocurrency/raiblocks/deployments","created_at":"2014-05-01T14:49:25Z","updated_at":"2018-12-23T10:50:56Z","pushed_at":"2018-12-22T21:42:26Z","git_url":"git://github.com/nanocurrency/raiblocks.git","ssh_url":"git@github.com:nanocurrency/raiblocks.git","clone_url":"https://github.com/nanocurrency/raiblocks.git","svn_url":"https://github.com/nanocurrency/raiblocks","homepage":"https://nano.org","size":16157,"stargazers_count":2458,"watchers_count":2458,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":520,"mirror_url":null,"archived":false,"open_issues_count":233,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":520,"open_issues":233,"watchers":2458,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nanocurrency/raiblocks/pulls/1498"},"html":{"href":"https://github.com/nanocurrency/raiblocks/pull/1498"},"issue":{"href":"https://api.github.com/repos/nanocurrency/raiblocks/issues/1498"},"comments":{"href":"https://api.github.com/repos/nanocurrency/raiblocks/issues/1498/comments"},"review_comments":{"href":"https://api.github.com/repos/nanocurrency/raiblocks/pulls/1498/comments"},"review_comment":{"href":"https://api.github.com/repos/nanocurrency/raiblocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nanocurrency/raiblocks/pulls/1498/commits"},"statuses":{"href":"https://api.github.com/repos/nanocurrency/raiblocks/statuses/74763ccf20951dbb88347d8643bbf11195d5c9b8"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":10,"deletions":10,"changed_files":1}}
{"actor":{"display_login":"wezrule"}}