{"action":"created","issue":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1217","repository_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines","labels_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1217/labels{/name}","comments_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1217/comments","events_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1217/events","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/1217","id":327300873,"node_id":"MDU6SXNzdWUzMjczMDA4NzM=","number":1217,"title":"F.52 explanation should mention on how to achieve const reference capture","user":{"login":"PeterSommerlad","id":1725845,"node_id":"MDQ6VXNlcjE3MjU4NDU=","avatar_url":"https://avatars1.githubusercontent.com/u/1725845?v=4","gravatar_id":"","url":"https://api.github.com/users/PeterSommerlad","html_url":"https://github.com/PeterSommerlad","followers_url":"https://api.github.com/users/PeterSommerlad/followers","following_url":"https://api.github.com/users/PeterSommerlad/following{/other_user}","gists_url":"https://api.github.com/users/PeterSommerlad/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterSommerlad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterSommerlad/subscriptions","organizations_url":"https://api.github.com/users/PeterSommerlad/orgs","repos_url":"https://api.github.com/users/PeterSommerlad/repos","events_url":"https://api.github.com/users/PeterSommerlad/events{/privacy}","received_events_url":"https://api.github.com/users/PeterSommerlad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-29T12:34:47Z","updated_at":"2018-06-18T18:38:35Z","closed_at":"2018-06-18T18:38:35Z","author_association":"NONE","body":"While efficient it might not be obvious how to capture a mutable (large) variable by const reference.\r\n\r\nOne option is to use std::cref():\r\n\r\n```\r\nstd::vector<double> var(1'000'000);\r\n[cr=std::cref(var)](){ /* use cr safely here */}\r\n```"},"comment":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/comments/398153804","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/1217#issuecomment-398153804","issue_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1217","id":398153804,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODE1MzgwNA==","user":{"login":"hsutter","id":1801526,"node_id":"MDQ6VXNlcjE4MDE1MjY=","avatar_url":"https://avatars1.githubusercontent.com/u/1801526?v=4","gravatar_id":"","url":"https://api.github.com/users/hsutter","html_url":"https://github.com/hsutter","followers_url":"https://api.github.com/users/hsutter/followers","following_url":"https://api.github.com/users/hsutter/following{/other_user}","gists_url":"https://api.github.com/users/hsutter/gists{/gist_id}","starred_url":"https://api.github.com/users/hsutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsutter/subscriptions","organizations_url":"https://api.github.com/users/hsutter/orgs","repos_url":"https://api.github.com/users/hsutter/repos","events_url":"https://api.github.com/users/hsutter/events{/privacy}","received_events_url":"https://api.github.com/users/hsutter/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T18:38:35Z","updated_at":"2018-06-18T18:38:35Z","author_association":"CONTRIBUTOR","body":"Editors call: We decided to not get into the detail of capturing a const reference at this time, but plan to look at it again next time we revise this item."}}
{"actor":{"display_login":"hsutter"}}