{"action":"created","comment":{"url":"https://api.github.com/repos/exercism/cpp/pulls/comments/124373734","pull_request_review_id":46656241,"id":124373734,"diff_hunk":"@@ -0,0 +1,46 @@\n+#include \"allergies.h\"\n+\n+#include <string>\n+#include <map>\n+#include <vector>\n+#include <algorithm>\n+\n+namespace allergies\n+{\n+\n+allergy_test::allergy_test(const int test_result)\n+    : result(test_result)\n+    , allergens({\n+    \t{\"eggs\", 1},\n+\t{\"peanuts\", 2},\n+\t{\"shellfish\", 4},\n+\t{\"strawberries\", 8},\n+\t{\"tomatoes\", 16},\n+\t{\"chocolate\", 32},\n+    \t{\"pollen\", 64},\n+\t{\"cats\", 128}\n+   })\n+{} \n+\n+bool allergy_test::is_allergic_to(std::string const& allergen) const\n+{\n+    int allergen_value = allergens.at(allergen);\n+    return (result & allergen_value) == allergen_value;\n+}\n+\n+std::vector<std::string> allergy_test::get_allergies() const\n+{\n+    std::vector<std::string> allergy_list({\"eggs\", \"peanuts\", \"shellfish\", \"strawberries\",\n+\t\t    \t\t\t   \"tomatoes\", \"chocolate\", \"pollen\", \"cats\"});","path":"exercises/allergies/example.cpp","position":34,"original_position":34,"commit_id":"c47707c943269deb52c8bca1fa3ebfc10def3639","original_commit_id":"c47707c943269deb52c8bca1fa3ebfc10def3639","user":{"login":"patricksjackson","id":160646,"avatar_url":"https://avatars0.githubusercontent.com/u/160646?v=3","gravatar_id":"","url":"https://api.github.com/users/patricksjackson","html_url":"https://github.com/patricksjackson","followers_url":"https://api.github.com/users/patricksjackson/followers","following_url":"https://api.github.com/users/patricksjackson/following{/other_user}","gists_url":"https://api.github.com/users/patricksjackson/gists{/gist_id}","starred_url":"https://api.github.com/users/patricksjackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patricksjackson/subscriptions","organizations_url":"https://api.github.com/users/patricksjackson/orgs","repos_url":"https://api.github.com/users/patricksjackson/repos","events_url":"https://api.github.com/users/patricksjackson/events{/privacy}","received_events_url":"https://api.github.com/users/patricksjackson/received_events","type":"User","site_admin":false},"body":"Instead of listing all these strings twice (here and in the map), do you think there's a way you can only list them once? Maybe by reading them from the map object here? Then, if you ever needed to update the names or what they mapped to you'd only have to change it in one place.","created_at":"2017-06-27T19:34:04Z","updated_at":"2017-06-27T19:34:04Z","html_url":"https://github.com/exercism/cpp/pull/132#discussion_r124373734","pull_request_url":"https://api.github.com/repos/exercism/cpp/pulls/132","_links":{"self":{"href":"https://api.github.com/repos/exercism/cpp/pulls/comments/124373734"},"html":{"href":"https://github.com/exercism/cpp/pull/132#discussion_r124373734"},"pull_request":{"href":"https://api.github.com/repos/exercism/cpp/pulls/132"}}},"pull_request":{"url":"https://api.github.com/repos/exercism/cpp/pulls/132","id":127339617,"html_url":"https://github.com/exercism/cpp/pull/132","diff_url":"https://github.com/exercism/cpp/pull/132.diff","patch_url":"https://github.com/exercism/cpp/pull/132.patch","issue_url":"https://api.github.com/repos/exercism/cpp/issues/132","number":132,"state":"open","locked":false,"title":"Port allergies exercise","user":{"login":"vivshaw","id":23173985,"avatar_url":"https://avatars3.githubusercontent.com/u/23173985?v=3","gravatar_id":"","url":"https://api.github.com/users/vivshaw","html_url":"https://github.com/vivshaw","followers_url":"https://api.github.com/users/vivshaw/followers","following_url":"https://api.github.com/users/vivshaw/following{/other_user}","gists_url":"https://api.github.com/users/vivshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/vivshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivshaw/subscriptions","organizations_url":"https://api.github.com/users/vivshaw/orgs","repos_url":"https://api.github.com/users/vivshaw/repos","events_url":"https://api.github.com/users/vivshaw/events{/privacy}","received_events_url":"https://api.github.com/users/vivshaw/received_events","type":"User","site_admin":false},"body":"First time porting one over; let me know if I need to fix anything / if I made some style errors & I'll get them fixed.\r\n\r\nWasn't sure where best to put it in config.json so it's at the end.\r\n\r\nAlso, would you prefer I squashed it all to 1 patch, or leave the commits separate like this?","created_at":"2017-06-24T18:54:09Z","updated_at":"2017-06-27T19:34:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dddc2924712536b24b870e9d8ffac3ab5cb7fbf1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/exercism/cpp/pulls/132/commits","review_comments_url":"https://api.github.com/repos/exercism/cpp/pulls/132/comments","review_comment_url":"https://api.github.com/repos/exercism/cpp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exercism/cpp/issues/132/comments","statuses_url":"https://api.github.com/repos/exercism/cpp/statuses/c47707c943269deb52c8bca1fa3ebfc10def3639","head":{"label":"vivshaw:allergies","ref":"allergies","sha":"c47707c943269deb52c8bca1fa3ebfc10def3639","user":{"login":"vivshaw","id":23173985,"avatar_url":"https://avatars3.githubusercontent.com/u/23173985?v=3","gravatar_id":"","url":"https://api.github.com/users/vivshaw","html_url":"https://github.com/vivshaw","followers_url":"https://api.github.com/users/vivshaw/followers","following_url":"https://api.github.com/users/vivshaw/following{/other_user}","gists_url":"https://api.github.com/users/vivshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/vivshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivshaw/subscriptions","organizations_url":"https://api.github.com/users/vivshaw/orgs","repos_url":"https://api.github.com/users/vivshaw/repos","events_url":"https://api.github.com/users/vivshaw/events{/privacy}","received_events_url":"https://api.github.com/users/vivshaw/received_events","type":"User","site_admin":false},"repo":{"id":94656517,"name":"xcpp","full_name":"vivshaw/xcpp","owner":{"login":"vivshaw","id":23173985,"avatar_url":"https://avatars3.githubusercontent.com/u/23173985?v=3","gravatar_id":"","url":"https://api.github.com/users/vivshaw","html_url":"https://github.com/vivshaw","followers_url":"https://api.github.com/users/vivshaw/followers","following_url":"https://api.github.com/users/vivshaw/following{/other_user}","gists_url":"https://api.github.com/users/vivshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/vivshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivshaw/subscriptions","organizations_url":"https://api.github.com/users/vivshaw/orgs","repos_url":"https://api.github.com/users/vivshaw/repos","events_url":"https://api.github.com/users/vivshaw/events{/privacy}","received_events_url":"https://api.github.com/users/vivshaw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vivshaw/xcpp","description":"Exercism exercises in C++.","fork":true,"url":"https://api.github.com/repos/vivshaw/xcpp","forks_url":"https://api.github.com/repos/vivshaw/xcpp/forks","keys_url":"https://api.github.com/repos/vivshaw/xcpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vivshaw/xcpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vivshaw/xcpp/teams","hooks_url":"https://api.github.com/repos/vivshaw/xcpp/hooks","issue_events_url":"https://api.github.com/repos/vivshaw/xcpp/issues/events{/number}","events_url":"https://api.github.com/repos/vivshaw/xcpp/events","assignees_url":"https://api.github.com/repos/vivshaw/xcpp/assignees{/user}","branches_url":"https://api.github.com/repos/vivshaw/xcpp/branches{/branch}","tags_url":"https://api.github.com/repos/vivshaw/xcpp/tags","blobs_url":"https://api.github.com/repos/vivshaw/xcpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vivshaw/xcpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vivshaw/xcpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/vivshaw/xcpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vivshaw/xcpp/statuses/{sha}","languages_url":"https://api.github.com/repos/vivshaw/xcpp/languages","stargazers_url":"https://api.github.com/repos/vivshaw/xcpp/stargazers","contributors_url":"https://api.github.com/repos/vivshaw/xcpp/contributors","subscribers_url":"https://api.github.com/repos/vivshaw/xcpp/subscribers","subscription_url":"https://api.github.com/repos/vivshaw/xcpp/subscription","commits_url":"https://api.github.com/repos/vivshaw/xcpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/vivshaw/xcpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/vivshaw/xcpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/vivshaw/xcpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/vivshaw/xcpp/contents/{+path}","compare_url":"https://api.github.com/repos/vivshaw/xcpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vivshaw/xcpp/merges","archive_url":"https://api.github.com/repos/vivshaw/xcpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vivshaw/xcpp/downloads","issues_url":"https://api.github.com/repos/vivshaw/xcpp/issues{/number}","pulls_url":"https://api.github.com/repos/vivshaw/xcpp/pulls{/number}","milestones_url":"https://api.github.com/repos/vivshaw/xcpp/milestones{/number}","notifications_url":"https://api.github.com/repos/vivshaw/xcpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vivshaw/xcpp/labels{/name}","releases_url":"https://api.github.com/repos/vivshaw/xcpp/releases{/id}","deployments_url":"https://api.github.com/repos/vivshaw/xcpp/deployments","created_at":"2017-06-18T00:30:45Z","updated_at":"2017-06-18T00:30:47Z","pushed_at":"2017-06-24T19:10:40Z","git_url":"git://github.com/vivshaw/xcpp.git","ssh_url":"git@github.com:vivshaw/xcpp.git","clone_url":"https://github.com/vivshaw/xcpp.git","svn_url":"https://github.com/vivshaw/xcpp","homepage":"http://exercism.io/languages/cpp","size":227,"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":"master"}},"base":{"label":"exercism:master","ref":"master","sha":"09fca4117526c14d522b7948b65675766c77045d","user":{"login":"exercism","id":5624255,"avatar_url":"https://avatars3.githubusercontent.com/u/5624255?v=3","gravatar_id":"","url":"https://api.github.com/users/exercism","html_url":"https://github.com/exercism","followers_url":"https://api.github.com/users/exercism/followers","following_url":"https://api.github.com/users/exercism/following{/other_user}","gists_url":"https://api.github.com/users/exercism/gists{/gist_id}","starred_url":"https://api.github.com/users/exercism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exercism/subscriptions","organizations_url":"https://api.github.com/users/exercism/orgs","repos_url":"https://api.github.com/users/exercism/repos","events_url":"https://api.github.com/users/exercism/events{/privacy}","received_events_url":"https://api.github.com/users/exercism/received_events","type":"Organization","site_admin":false},"repo":{"id":17814605,"name":"cpp","full_name":"exercism/cpp","owner":{"login":"exercism","id":5624255,"avatar_url":"https://avatars3.githubusercontent.com/u/5624255?v=3","gravatar_id":"","url":"https://api.github.com/users/exercism","html_url":"https://github.com/exercism","followers_url":"https://api.github.com/users/exercism/followers","following_url":"https://api.github.com/users/exercism/following{/other_user}","gists_url":"https://api.github.com/users/exercism/gists{/gist_id}","starred_url":"https://api.github.com/users/exercism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exercism/subscriptions","organizations_url":"https://api.github.com/users/exercism/orgs","repos_url":"https://api.github.com/users/exercism/repos","events_url":"https://api.github.com/users/exercism/events{/privacy}","received_events_url":"https://api.github.com/users/exercism/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exercism/cpp","description":"Exercism exercises in C++.","fork":false,"url":"https://api.github.com/repos/exercism/cpp","forks_url":"https://api.github.com/repos/exercism/cpp/forks","keys_url":"https://api.github.com/repos/exercism/cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exercism/cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exercism/cpp/teams","hooks_url":"https://api.github.com/repos/exercism/cpp/hooks","issue_events_url":"https://api.github.com/repos/exercism/cpp/issues/events{/number}","events_url":"https://api.github.com/repos/exercism/cpp/events","assignees_url":"https://api.github.com/repos/exercism/cpp/assignees{/user}","branches_url":"https://api.github.com/repos/exercism/cpp/branches{/branch}","tags_url":"https://api.github.com/repos/exercism/cpp/tags","blobs_url":"https://api.github.com/repos/exercism/cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exercism/cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exercism/cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/exercism/cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exercism/cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/exercism/cpp/languages","stargazers_url":"https://api.github.com/repos/exercism/cpp/stargazers","contributors_url":"https://api.github.com/repos/exercism/cpp/contributors","subscribers_url":"https://api.github.com/repos/exercism/cpp/subscribers","subscription_url":"https://api.github.com/repos/exercism/cpp/subscription","commits_url":"https://api.github.com/repos/exercism/cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/exercism/cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/exercism/cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/exercism/cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/exercism/cpp/contents/{+path}","compare_url":"https://api.github.com/repos/exercism/cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exercism/cpp/merges","archive_url":"https://api.github.com/repos/exercism/cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exercism/cpp/downloads","issues_url":"https://api.github.com/repos/exercism/cpp/issues{/number}","pulls_url":"https://api.github.com/repos/exercism/cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/exercism/cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/exercism/cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exercism/cpp/labels{/name}","releases_url":"https://api.github.com/repos/exercism/cpp/releases{/id}","deployments_url":"https://api.github.com/repos/exercism/cpp/deployments","created_at":"2014-03-17T02:12:04Z","updated_at":"2017-06-21T03:50:44Z","pushed_at":"2017-06-24T19:10:41Z","git_url":"git://github.com/exercism/cpp.git","ssh_url":"git@github.com:exercism/cpp.git","clone_url":"https://github.com/exercism/cpp.git","svn_url":"https://github.com/exercism/cpp","homepage":"http://exercism.io/languages/cpp","size":214,"stargazers_count":36,"watchers_count":36,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":13,"forks":46,"open_issues":13,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exercism/cpp/pulls/132"},"html":{"href":"https://github.com/exercism/cpp/pull/132"},"issue":{"href":"https://api.github.com/repos/exercism/cpp/issues/132"},"comments":{"href":"https://api.github.com/repos/exercism/cpp/issues/132/comments"},"review_comments":{"href":"https://api.github.com/repos/exercism/cpp/pulls/132/comments"},"review_comment":{"href":"https://api.github.com/repos/exercism/cpp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exercism/cpp/pulls/132/commits"},"statuses":{"href":"https://api.github.com/repos/exercism/cpp/statuses/c47707c943269deb52c8bca1fa3ebfc10def3639"}}}}
{"actor":{"display_login":"patricksjackson"}}