{"action":"created","comment":{"url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/comments/80801560","pull_request_review_id":1831348,"id":80801560,"diff_hunk":"@@ -7,80 +7,219 @@\n \n #include \"tbitfield.h\"\n \n-TBitField::TBitField(int len)\n-{\n+TBitField::TBitField(int len) {\n+\t//try (контролировать), catch (ловить), throw (порождать)\n+\tTELEM bits;\n+\tif (len<0) {\n+\t\tthrow invalid_argument(\"Len<0...\");\n+\t}\n+\tbits = (len + (BitInTELEM - 1)) / BitInTELEM;\n+\tMemLen = bits;\n+\tBitLen = len;\n+\tpMem = new TELEM[MemLen];\n+\tfor (int i = 0; i < MemLen; i++) {\n+\t\tpMem[i] = 0;\n+\t}\n }\n \n TBitField::TBitField(const TBitField &bf) // конструктор копирования\n {\n+\tBitLen = bf.BitLen;\n+\tMemLen = bf.MemLen;\n+\tpMem = new TELEM[MemLen];\n+\tfor (int i = 0; i < MemLen; i++)\n+\t\tpMem[i] = bf.pMem[i];\n+\n }\n \n-TBitField::~TBitField()\n-{\n+TBitField::~TBitField() {\n+\tdelete[]pMem;\n }\n \n int TBitField::GetMemIndex(const int n) const // индекс Мем для бита n\n {\n+\n+\treturn n / BitInTELEM;\n }\n \n TELEM TBitField::GetMemMask(const int n) const // битовая маска для бита n\n {\n+\treturn 1 << (n & (BitInTELEM - 1));\n }\n \n // доступ к битам битового поля\n \n int TBitField::GetLength(void) const // получить длину (к-во битов)\n {\n-  return 0;\n+\treturn BitLen;\n }\n \n void TBitField::SetBit(const int n) // установить бит\n {\n+\tif (n<0) {\n+\t\tthrow invalid_argument(\"Bit < 0...\");\n+\t}\n+\tif (n>BitLen) {\n+\t\tthrow invalid_argument(\"BitLen < n...\");\n+\t}\n+\tpMem[GetMemIndex(n)] = pMem[GetMemIndex(n)] | GetMemMask(n);\n }\n \n void TBitField::ClrBit(const int n) // очистить бит\n {\n+\tif (n<0) {\n+\t\tthrow invalid_argument(\"Bit < 0...\");\n+\t}\n+\tif (n>BitLen) {\n+\t\tthrow invalid_argument(\"BitLen < n...\");\n+\t}\n+\tpMem[GetMemIndex(n)] = pMem[GetMemIndex(n)] & ~GetMemMask(n);\n }\n \n int TBitField::GetBit(const int n) const // получить значение бита\n {\n-  return 0;\n+\tif (n<0) {\n+\t\tthrow invalid_argument(\"n < 0...\");\n+\t}\n+\tif (n>BitLen) {\n+\t\tthrow invalid_argument(\"BitLen < n...\");\n+\t}\n+\tif ((pMem[GetMemIndex(n)] & GetMemMask(n)) == 0) return 0;\n+\telse return 1;\n }\n \n // битовые операции\n \n TBitField& TBitField::operator=(const TBitField &bf) // присваивание\n {\n+\tif (pMem != bf.pMem) {\n+\t\tBitLen = bf.BitLen;\n+\t\tMemLen = bf.MemLen;\n+\t\tdelete[]pMem;\n+\t\tpMem = new TELEM[MemLen];","path":"src/tbitfield.cpp","position":99,"original_position":99,"commit_id":"ef9a8e74c90a32a9b90aca5a69de33a5e6cf2a78","original_commit_id":"b24a9ab6b42e48b3ce3c8f3c8626f0200024d816","user":{"login":"pavelbar","id":20696259,"avatar_url":"https://avatars.githubusercontent.com/u/20696259?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelbar","html_url":"https://github.com/pavelbar","followers_url":"https://api.github.com/users/pavelbar/followers","following_url":"https://api.github.com/users/pavelbar/following{/other_user}","gists_url":"https://api.github.com/users/pavelbar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelbar/subscriptions","organizations_url":"https://api.github.com/users/pavelbar/orgs","repos_url":"https://api.github.com/users/pavelbar/repos","events_url":"https://api.github.com/users/pavelbar/events{/privacy}","received_events_url":"https://api.github.com/users/pavelbar/received_events","type":"User","site_admin":false},"body":"fix","created_at":"2016-09-27T21:38:41Z","updated_at":"2016-09-27T21:38:41Z","html_url":"https://github.com/pavelbar/mp2-lab1-set/pull/1#discussion_r80801560","pull_request_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/comments/80801560"},"html":{"href":"https://github.com/pavelbar/mp2-lab1-set/pull/1#discussion_r80801560"},"pull_request":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/1","id":86989221,"html_url":"https://github.com/pavelbar/mp2-lab1-set/pull/1","diff_url":"https://github.com/pavelbar/mp2-lab1-set/pull/1.diff","patch_url":"https://github.com/pavelbar/mp2-lab1-set/pull/1.patch","issue_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues/1","number":1,"state":"closed","locked":false,"title":"Отчет","user":{"login":"pavelbar","id":20696259,"avatar_url":"https://avatars.githubusercontent.com/u/20696259?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelbar","html_url":"https://github.com/pavelbar","followers_url":"https://api.github.com/users/pavelbar/followers","following_url":"https://api.github.com/users/pavelbar/following{/other_user}","gists_url":"https://api.github.com/users/pavelbar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelbar/subscriptions","organizations_url":"https://api.github.com/users/pavelbar/orgs","repos_url":"https://api.github.com/users/pavelbar/repos","events_url":"https://api.github.com/users/pavelbar/events{/privacy}","received_events_url":"https://api.github.com/users/pavelbar/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-27T18:50:05Z","updated_at":"2016-09-27T21:38:41Z","closed_at":"2016-09-27T19:24:56Z","merged_at":null,"merge_commit_sha":"6a688bbefe051e0e9cd97956633400d1a5d3aa20","assignee":{"login":"alvls","id":5449780,"avatar_url":"https://avatars.githubusercontent.com/u/5449780?v=3","gravatar_id":"","url":"https://api.github.com/users/alvls","html_url":"https://github.com/alvls","followers_url":"https://api.github.com/users/alvls/followers","following_url":"https://api.github.com/users/alvls/following{/other_user}","gists_url":"https://api.github.com/users/alvls/gists{/gist_id}","starred_url":"https://api.github.com/users/alvls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvls/subscriptions","organizations_url":"https://api.github.com/users/alvls/orgs","repos_url":"https://api.github.com/users/alvls/repos","events_url":"https://api.github.com/users/alvls/events{/privacy}","received_events_url":"https://api.github.com/users/alvls/received_events","type":"User","site_admin":false},"assignees":[{"login":"alvls","id":5449780,"avatar_url":"https://avatars.githubusercontent.com/u/5449780?v=3","gravatar_id":"","url":"https://api.github.com/users/alvls","html_url":"https://github.com/alvls","followers_url":"https://api.github.com/users/alvls/followers","following_url":"https://api.github.com/users/alvls/following{/other_user}","gists_url":"https://api.github.com/users/alvls/gists{/gist_id}","starred_url":"https://api.github.com/users/alvls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvls/subscriptions","organizations_url":"https://api.github.com/users/alvls/orgs","repos_url":"https://api.github.com/users/alvls/repos","events_url":"https://api.github.com/users/alvls/events{/privacy}","received_events_url":"https://api.github.com/users/alvls/received_events","type":"User","site_admin":false},{"login":"pavelbar","id":20696259,"avatar_url":"https://avatars.githubusercontent.com/u/20696259?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelbar","html_url":"https://github.com/pavelbar","followers_url":"https://api.github.com/users/pavelbar/followers","following_url":"https://api.github.com/users/pavelbar/following{/other_user}","gists_url":"https://api.github.com/users/pavelbar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelbar/subscriptions","organizations_url":"https://api.github.com/users/pavelbar/orgs","repos_url":"https://api.github.com/users/pavelbar/repos","events_url":"https://api.github.com/users/pavelbar/events{/privacy}","received_events_url":"https://api.github.com/users/pavelbar/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/1/commits","review_comments_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/1/comments","review_comment_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues/1/comments","statuses_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/statuses/ef9a8e74c90a32a9b90aca5a69de33a5e6cf2a78","head":{"label":"pavelbar:work","ref":"work","sha":"ef9a8e74c90a32a9b90aca5a69de33a5e6cf2a78","user":{"login":"pavelbar","id":20696259,"avatar_url":"https://avatars.githubusercontent.com/u/20696259?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelbar","html_url":"https://github.com/pavelbar","followers_url":"https://api.github.com/users/pavelbar/followers","following_url":"https://api.github.com/users/pavelbar/following{/other_user}","gists_url":"https://api.github.com/users/pavelbar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelbar/subscriptions","organizations_url":"https://api.github.com/users/pavelbar/orgs","repos_url":"https://api.github.com/users/pavelbar/repos","events_url":"https://api.github.com/users/pavelbar/events{/privacy}","received_events_url":"https://api.github.com/users/pavelbar/received_events","type":"User","site_admin":false},"repo":{"id":69382593,"name":"mp2-lab1-set","full_name":"pavelbar/mp2-lab1-set","owner":{"login":"pavelbar","id":20696259,"avatar_url":"https://avatars.githubusercontent.com/u/20696259?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelbar","html_url":"https://github.com/pavelbar","followers_url":"https://api.github.com/users/pavelbar/followers","following_url":"https://api.github.com/users/pavelbar/following{/other_user}","gists_url":"https://api.github.com/users/pavelbar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelbar/subscriptions","organizations_url":"https://api.github.com/users/pavelbar/orgs","repos_url":"https://api.github.com/users/pavelbar/repos","events_url":"https://api.github.com/users/pavelbar/events{/privacy}","received_events_url":"https://api.github.com/users/pavelbar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pavelbar/mp2-lab1-set","description":"Проект-шаблон для выполнения первого практического задания по курсу МП2","fork":true,"url":"https://api.github.com/repos/pavelbar/mp2-lab1-set","forks_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/forks","keys_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/teams","hooks_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/hooks","issue_events_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues/events{/number}","events_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/events","assignees_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/assignees{/user}","branches_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/branches{/branch}","tags_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/tags","blobs_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/refs{/sha}","trees_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/statuses/{sha}","languages_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/languages","stargazers_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/stargazers","contributors_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/contributors","subscribers_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/subscribers","subscription_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/subscription","commits_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/commits{/sha}","git_commits_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/commits{/sha}","comments_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/comments{/number}","issue_comment_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues/comments{/number}","contents_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/contents/{+path}","compare_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/merges","archive_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/downloads","issues_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues{/number}","pulls_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls{/number}","milestones_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/milestones{/number}","notifications_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/labels{/name}","releases_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/releases{/id}","deployments_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/deployments","created_at":"2016-09-27T17:39:11Z","updated_at":"2016-09-27T17:39:12Z","pushed_at":"2016-09-27T21:38:04Z","git_url":"git://github.com/pavelbar/mp2-lab1-set.git","ssh_url":"git@github.com:pavelbar/mp2-lab1-set.git","clone_url":"https://github.com/pavelbar/mp2-lab1-set.git","svn_url":"https://github.com/pavelbar/mp2-lab1-set","homepage":"http://www.software.unn.ru/?doc=507","size":24904,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"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":"pavelbar:master","ref":"master","sha":"63ba637824dccce54346614e0cdeda2ca035503c","user":{"login":"pavelbar","id":20696259,"avatar_url":"https://avatars.githubusercontent.com/u/20696259?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelbar","html_url":"https://github.com/pavelbar","followers_url":"https://api.github.com/users/pavelbar/followers","following_url":"https://api.github.com/users/pavelbar/following{/other_user}","gists_url":"https://api.github.com/users/pavelbar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelbar/subscriptions","organizations_url":"https://api.github.com/users/pavelbar/orgs","repos_url":"https://api.github.com/users/pavelbar/repos","events_url":"https://api.github.com/users/pavelbar/events{/privacy}","received_events_url":"https://api.github.com/users/pavelbar/received_events","type":"User","site_admin":false},"repo":{"id":69382593,"name":"mp2-lab1-set","full_name":"pavelbar/mp2-lab1-set","owner":{"login":"pavelbar","id":20696259,"avatar_url":"https://avatars.githubusercontent.com/u/20696259?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelbar","html_url":"https://github.com/pavelbar","followers_url":"https://api.github.com/users/pavelbar/followers","following_url":"https://api.github.com/users/pavelbar/following{/other_user}","gists_url":"https://api.github.com/users/pavelbar/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelbar/subscriptions","organizations_url":"https://api.github.com/users/pavelbar/orgs","repos_url":"https://api.github.com/users/pavelbar/repos","events_url":"https://api.github.com/users/pavelbar/events{/privacy}","received_events_url":"https://api.github.com/users/pavelbar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pavelbar/mp2-lab1-set","description":"Проект-шаблон для выполнения первого практического задания по курсу МП2","fork":true,"url":"https://api.github.com/repos/pavelbar/mp2-lab1-set","forks_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/forks","keys_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/teams","hooks_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/hooks","issue_events_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues/events{/number}","events_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/events","assignees_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/assignees{/user}","branches_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/branches{/branch}","tags_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/tags","blobs_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/refs{/sha}","trees_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/statuses/{sha}","languages_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/languages","stargazers_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/stargazers","contributors_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/contributors","subscribers_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/subscribers","subscription_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/subscription","commits_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/commits{/sha}","git_commits_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/git/commits{/sha}","comments_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/comments{/number}","issue_comment_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues/comments{/number}","contents_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/contents/{+path}","compare_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/merges","archive_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/downloads","issues_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues{/number}","pulls_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls{/number}","milestones_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/milestones{/number}","notifications_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/labels{/name}","releases_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/releases{/id}","deployments_url":"https://api.github.com/repos/pavelbar/mp2-lab1-set/deployments","created_at":"2016-09-27T17:39:11Z","updated_at":"2016-09-27T17:39:12Z","pushed_at":"2016-09-27T21:38:04Z","git_url":"git://github.com/pavelbar/mp2-lab1-set.git","ssh_url":"git@github.com:pavelbar/mp2-lab1-set.git","clone_url":"https://github.com/pavelbar/mp2-lab1-set.git","svn_url":"https://github.com/pavelbar/mp2-lab1-set","homepage":"http://www.software.unn.ru/?doc=507","size":24904,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"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"}},"_links":{"self":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/1"},"html":{"href":"https://github.com/pavelbar/mp2-lab1-set/pull/1"},"issue":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues/1"},"comments":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/pavelbar/mp2-lab1-set/statuses/ef9a8e74c90a32a9b90aca5a69de33a5e6cf2a78"}}}}
{"actor":{"display_login":"pavelbar"}}