{"action":"created","comment":{"url":"https://api.github.com/repos/nlohmann/json/pulls/comments/143138832","pull_request_review_id":67606713,"id":143138832,"diff_hunk":"@@ -2880,34 +2833,30 @@ class lexer\n \n   private:\n     /// input adapter\n-    detail::input_adapter_t ia = nullptr;\n+    detail::input_adapter_t ia { nullptr };","path":"src/json.hpp","position":381,"original_position":368,"commit_id":"1b43a45bec8057fba315c3eccd91d567cd32a273","original_commit_id":"de97f8c31c315cb67e529446eda4fe72ba7e1a56","user":{"login":"nlohmann","id":159488,"avatar_url":"https://avatars2.githubusercontent.com/u/159488?v=4","gravatar_id":"","url":"https://api.github.com/users/nlohmann","html_url":"https://github.com/nlohmann","followers_url":"https://api.github.com/users/nlohmann/followers","following_url":"https://api.github.com/users/nlohmann/following{/other_user}","gists_url":"https://api.github.com/users/nlohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/nlohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlohmann/subscriptions","organizations_url":"https://api.github.com/users/nlohmann/orgs","repos_url":"https://api.github.com/users/nlohmann/repos","events_url":"https://api.github.com/users/nlohmann/events{/privacy}","received_events_url":"https://api.github.com/users/nlohmann/received_events","type":"User","site_admin":false},"body":"I'm ok with letting it as it is. But just because braces work everywhere does not mean that `ia = nullptr;` is wrong in any sense. That's why *I* don't think we should change existing code.","created_at":"2017-10-06T08:52:49Z","updated_at":"2017-10-06T08:52:49Z","html_url":"https://github.com/nlohmann/json/pull/764#discussion_r143138832","pull_request_url":"https://api.github.com/repos/nlohmann/json/pulls/764","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/nlohmann/json/pulls/comments/143138832"},"html":{"href":"https://github.com/nlohmann/json/pull/764#discussion_r143138832"},"pull_request":{"href":"https://api.github.com/repos/nlohmann/json/pulls/764"}},"in_reply_to_id":143012496},"pull_request":{"url":"https://api.github.com/repos/nlohmann/json/pulls/764","id":144288677,"html_url":"https://github.com/nlohmann/json/pull/764","diff_url":"https://github.com/nlohmann/json/pull/764.diff","patch_url":"https://github.com/nlohmann/json/pull/764.patch","issue_url":"https://api.github.com/repos/nlohmann/json/issues/764","number":764,"state":"open","locked":false,"title":"Simplified istream handing #367","user":{"login":"pjkundert","id":290924,"avatar_url":"https://avatars1.githubusercontent.com/u/290924?v=4","gravatar_id":"","url":"https://api.github.com/users/pjkundert","html_url":"https://github.com/pjkundert","followers_url":"https://api.github.com/users/pjkundert/followers","following_url":"https://api.github.com/users/pjkundert/following{/other_user}","gists_url":"https://api.github.com/users/pjkundert/gists{/gist_id}","starred_url":"https://api.github.com/users/pjkundert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjkundert/subscriptions","organizations_url":"https://api.github.com/users/pjkundert/orgs","repos_url":"https://api.github.com/users/pjkundert/repos","events_url":"https://api.github.com/users/pjkundert/events{/privacy}","received_events_url":"https://api.github.com/users/pjkundert/received_events","type":"User","site_admin":false},"body":"Simplified cached_input_stream_adapter<> to input_stream_adapter, to avoid redundant buffering (already buffered in underlying std::streambuf), and thus to not pre-load (and discard) a large buffer of input from the istream when parsing a smaller JSON record.  Handles a leading Byte Order Mark using standard istream putback/unget.\r\n\r\nAlso, instead of trying to re-read the previous token on error (which involved seeking, which may or may not be available on an istream), simply collects the developing token into a std::string.  The space underlying this string is preserved between tokens, so this collection devolves into simple copying, and is therefore quite efficient.\r\n\r\nThis also opens the door to further simplifications in the future.\r\n\r\nAdded a simple unit test to confirm operation.  Did not test effect on json::parse.  I feel that the approach suggested by @nlohmann (std::parse demands that the entire buffer be a single JSON object, but operator>> scans just a single upcoming JSON object) is correct...  Perhaps this pull request may help move in that direction.","created_at":"2017-10-02T21:30:22Z","updated_at":"2017-10-06T08:52:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70304eb4ca39d0d7c23b6c264daf48fb066ad3e4","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/nlohmann/json/pulls/764/commits","review_comments_url":"https://api.github.com/repos/nlohmann/json/pulls/764/comments","review_comment_url":"https://api.github.com/repos/nlohmann/json/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nlohmann/json/issues/764/comments","statuses_url":"https://api.github.com/repos/nlohmann/json/statuses/1b43a45bec8057fba315c3eccd91d567cd32a273","head":{"label":"pjkundert:develop-simplify-istream","ref":"develop-simplify-istream","sha":"1b43a45bec8057fba315c3eccd91d567cd32a273","user":{"login":"pjkundert","id":290924,"avatar_url":"https://avatars1.githubusercontent.com/u/290924?v=4","gravatar_id":"","url":"https://api.github.com/users/pjkundert","html_url":"https://github.com/pjkundert","followers_url":"https://api.github.com/users/pjkundert/followers","following_url":"https://api.github.com/users/pjkundert/following{/other_user}","gists_url":"https://api.github.com/users/pjkundert/gists{/gist_id}","starred_url":"https://api.github.com/users/pjkundert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjkundert/subscriptions","organizations_url":"https://api.github.com/users/pjkundert/orgs","repos_url":"https://api.github.com/users/pjkundert/repos","events_url":"https://api.github.com/users/pjkundert/events{/privacy}","received_events_url":"https://api.github.com/users/pjkundert/received_events","type":"User","site_admin":false},"repo":{"id":103140102,"name":"json","full_name":"pjkundert/json","owner":{"login":"pjkundert","id":290924,"avatar_url":"https://avatars1.githubusercontent.com/u/290924?v=4","gravatar_id":"","url":"https://api.github.com/users/pjkundert","html_url":"https://github.com/pjkundert","followers_url":"https://api.github.com/users/pjkundert/followers","following_url":"https://api.github.com/users/pjkundert/following{/other_user}","gists_url":"https://api.github.com/users/pjkundert/gists{/gist_id}","starred_url":"https://api.github.com/users/pjkundert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjkundert/subscriptions","organizations_url":"https://api.github.com/users/pjkundert/orgs","repos_url":"https://api.github.com/users/pjkundert/repos","events_url":"https://api.github.com/users/pjkundert/events{/privacy}","received_events_url":"https://api.github.com/users/pjkundert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pjkundert/json","description":"JSON for Modern C++","fork":true,"url":"https://api.github.com/repos/pjkundert/json","forks_url":"https://api.github.com/repos/pjkundert/json/forks","keys_url":"https://api.github.com/repos/pjkundert/json/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pjkundert/json/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pjkundert/json/teams","hooks_url":"https://api.github.com/repos/pjkundert/json/hooks","issue_events_url":"https://api.github.com/repos/pjkundert/json/issues/events{/number}","events_url":"https://api.github.com/repos/pjkundert/json/events","assignees_url":"https://api.github.com/repos/pjkundert/json/assignees{/user}","branches_url":"https://api.github.com/repos/pjkundert/json/branches{/branch}","tags_url":"https://api.github.com/repos/pjkundert/json/tags","blobs_url":"https://api.github.com/repos/pjkundert/json/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pjkundert/json/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pjkundert/json/git/refs{/sha}","trees_url":"https://api.github.com/repos/pjkundert/json/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pjkundert/json/statuses/{sha}","languages_url":"https://api.github.com/repos/pjkundert/json/languages","stargazers_url":"https://api.github.com/repos/pjkundert/json/stargazers","contributors_url":"https://api.github.com/repos/pjkundert/json/contributors","subscribers_url":"https://api.github.com/repos/pjkundert/json/subscribers","subscription_url":"https://api.github.com/repos/pjkundert/json/subscription","commits_url":"https://api.github.com/repos/pjkundert/json/commits{/sha}","git_commits_url":"https://api.github.com/repos/pjkundert/json/git/commits{/sha}","comments_url":"https://api.github.com/repos/pjkundert/json/comments{/number}","issue_comment_url":"https://api.github.com/repos/pjkundert/json/issues/comments{/number}","contents_url":"https://api.github.com/repos/pjkundert/json/contents/{+path}","compare_url":"https://api.github.com/repos/pjkundert/json/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pjkundert/json/merges","archive_url":"https://api.github.com/repos/pjkundert/json/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pjkundert/json/downloads","issues_url":"https://api.github.com/repos/pjkundert/json/issues{/number}","pulls_url":"https://api.github.com/repos/pjkundert/json/pulls{/number}","milestones_url":"https://api.github.com/repos/pjkundert/json/milestones{/number}","notifications_url":"https://api.github.com/repos/pjkundert/json/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pjkundert/json/labels{/name}","releases_url":"https://api.github.com/repos/pjkundert/json/releases{/id}","deployments_url":"https://api.github.com/repos/pjkundert/json/deployments","created_at":"2017-09-11T13:35:23Z","updated_at":"2017-09-11T13:35:26Z","pushed_at":"2017-10-05T23:18:47Z","git_url":"git://github.com/pjkundert/json.git","ssh_url":"git@github.com:pjkundert/json.git","clone_url":"https://github.com/pjkundert/json.git","svn_url":"https://github.com/pjkundert/json","homepage":"https://nlohmann.github.io/json/","size":140725,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"nlohmann:develop","ref":"develop","sha":"0c0851dbea0c7457db248d144773b8fcfe8b59ce","user":{"login":"nlohmann","id":159488,"avatar_url":"https://avatars2.githubusercontent.com/u/159488?v=4","gravatar_id":"","url":"https://api.github.com/users/nlohmann","html_url":"https://github.com/nlohmann","followers_url":"https://api.github.com/users/nlohmann/followers","following_url":"https://api.github.com/users/nlohmann/following{/other_user}","gists_url":"https://api.github.com/users/nlohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/nlohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlohmann/subscriptions","organizations_url":"https://api.github.com/users/nlohmann/orgs","repos_url":"https://api.github.com/users/nlohmann/repos","events_url":"https://api.github.com/users/nlohmann/events{/privacy}","received_events_url":"https://api.github.com/users/nlohmann/received_events","type":"User","site_admin":false},"repo":{"id":11171548,"name":"json","full_name":"nlohmann/json","owner":{"login":"nlohmann","id":159488,"avatar_url":"https://avatars2.githubusercontent.com/u/159488?v=4","gravatar_id":"","url":"https://api.github.com/users/nlohmann","html_url":"https://github.com/nlohmann","followers_url":"https://api.github.com/users/nlohmann/followers","following_url":"https://api.github.com/users/nlohmann/following{/other_user}","gists_url":"https://api.github.com/users/nlohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/nlohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlohmann/subscriptions","organizations_url":"https://api.github.com/users/nlohmann/orgs","repos_url":"https://api.github.com/users/nlohmann/repos","events_url":"https://api.github.com/users/nlohmann/events{/privacy}","received_events_url":"https://api.github.com/users/nlohmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nlohmann/json","description":"JSON for Modern C++","fork":false,"url":"https://api.github.com/repos/nlohmann/json","forks_url":"https://api.github.com/repos/nlohmann/json/forks","keys_url":"https://api.github.com/repos/nlohmann/json/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nlohmann/json/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nlohmann/json/teams","hooks_url":"https://api.github.com/repos/nlohmann/json/hooks","issue_events_url":"https://api.github.com/repos/nlohmann/json/issues/events{/number}","events_url":"https://api.github.com/repos/nlohmann/json/events","assignees_url":"https://api.github.com/repos/nlohmann/json/assignees{/user}","branches_url":"https://api.github.com/repos/nlohmann/json/branches{/branch}","tags_url":"https://api.github.com/repos/nlohmann/json/tags","blobs_url":"https://api.github.com/repos/nlohmann/json/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nlohmann/json/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nlohmann/json/git/refs{/sha}","trees_url":"https://api.github.com/repos/nlohmann/json/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nlohmann/json/statuses/{sha}","languages_url":"https://api.github.com/repos/nlohmann/json/languages","stargazers_url":"https://api.github.com/repos/nlohmann/json/stargazers","contributors_url":"https://api.github.com/repos/nlohmann/json/contributors","subscribers_url":"https://api.github.com/repos/nlohmann/json/subscribers","subscription_url":"https://api.github.com/repos/nlohmann/json/subscription","commits_url":"https://api.github.com/repos/nlohmann/json/commits{/sha}","git_commits_url":"https://api.github.com/repos/nlohmann/json/git/commits{/sha}","comments_url":"https://api.github.com/repos/nlohmann/json/comments{/number}","issue_comment_url":"https://api.github.com/repos/nlohmann/json/issues/comments{/number}","contents_url":"https://api.github.com/repos/nlohmann/json/contents/{+path}","compare_url":"https://api.github.com/repos/nlohmann/json/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nlohmann/json/merges","archive_url":"https://api.github.com/repos/nlohmann/json/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nlohmann/json/downloads","issues_url":"https://api.github.com/repos/nlohmann/json/issues{/number}","pulls_url":"https://api.github.com/repos/nlohmann/json/pulls{/number}","milestones_url":"https://api.github.com/repos/nlohmann/json/milestones{/number}","notifications_url":"https://api.github.com/repos/nlohmann/json/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nlohmann/json/labels{/name}","releases_url":"https://api.github.com/repos/nlohmann/json/releases{/id}","deployments_url":"https://api.github.com/repos/nlohmann/json/deployments","created_at":"2013-07-04T08:47:49Z","updated_at":"2017-10-06T05:39:23Z","pushed_at":"2017-10-05T23:18:49Z","git_url":"git://github.com/nlohmann/json.git","ssh_url":"git@github.com:nlohmann/json.git","clone_url":"https://github.com/nlohmann/json.git","svn_url":"https://github.com/nlohmann/json","homepage":"https://nlohmann.github.io/json/","size":140728,"stargazers_count":6706,"watchers_count":6706,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1064,"mirror_url":null,"open_issues_count":21,"forks":1064,"open_issues":21,"watchers":6706,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/nlohmann/json/pulls/764"},"html":{"href":"https://github.com/nlohmann/json/pull/764"},"issue":{"href":"https://api.github.com/repos/nlohmann/json/issues/764"},"comments":{"href":"https://api.github.com/repos/nlohmann/json/issues/764/comments"},"review_comments":{"href":"https://api.github.com/repos/nlohmann/json/pulls/764/comments"},"review_comment":{"href":"https://api.github.com/repos/nlohmann/json/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nlohmann/json/pulls/764/commits"},"statuses":{"href":"https://api.github.com/repos/nlohmann/json/statuses/1b43a45bec8057fba315c3eccd91d567cd32a273"}},"author_association":"NONE"}}
{"actor":{"display_login":"nlohmann"}}