{"action":"created","comment":{"url":"https://api.github.com/repos/art-kosm/homeworks/pulls/comments/31023815","id":31023815,"diff_hunk":"@@ -0,0 +1,55 @@\n+#pragma once\n+\n+#include \"linkedList.h\"\n+\n+template <typename T>\n+class SharedPointer\n+{\n+public:\n+    SharedPointer() {}\n+\n+    SharedPointer(T *newObject) : object(newObject)\n+    {\n+        objectsList->add(object);\n+    }\n+\n+    SharedPointer(const SharedPointer &pointer) : object(&*pointer)\n+    {\n+        objectsList->add(object);\n+    }\n+\n+    ~SharedPointer()\n+    {\n+        objectsList->remove(object);\n+\n+        if (objectsList->length() == 0)\n+            delete objectsList;\n+    }\n+\n+    SharedPointer& operator=(const SharedPointer &pointer)\n+    {\n+        return new SharedPointer(&*pointer);\n+    }\n+\n+    T* operator->() const\n+    {\n+        return object;\n+    }\n+\n+    T& operator*() const\n+    {\n+        return *object;\n+    }\n+\n+    int count() const\n+    {\n+        return objectsList->count(object);","path":"term_2/homework_07/smart_pointer/sharedPointer.h","position":46,"original_position":46,"commit_id":"0e2cc2c2a449d2e0cc371a7313fced4db4a51a3e","original_commit_id":"0e2cc2c2a449d2e0cc371a7313fced4db4a51a3e","user":{"login":"jzuken","id":705678,"avatar_url":"https://avatars.githubusercontent.com/u/705678?v=3","gravatar_id":"","url":"https://api.github.com/users/jzuken","html_url":"https://github.com/jzuken","followers_url":"https://api.github.com/users/jzuken/followers","following_url":"https://api.github.com/users/jzuken/following{/other_user}","gists_url":"https://api.github.com/users/jzuken/gists{/gist_id}","starred_url":"https://api.github.com/users/jzuken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzuken/subscriptions","organizations_url":"https://api.github.com/users/jzuken/orgs","repos_url":"https://api.github.com/users/jzuken/repos","events_url":"https://api.github.com/users/jzuken/events{/privacy}","received_events_url":"https://api.github.com/users/jzuken/received_events","type":"User","site_admin":false},"body":"по-моему, вы что-то не то считаете. если я создам такой умный указатель на какой-то участок памяти, а потом создаем еще один туда же, у меня count() должен два выдавать. а вы скорее считаете, на сколько участков памяти ссылается каждый SharedPointer. это число всегда 1 вроде как","created_at":"2015-05-26T11:18:57Z","updated_at":"2015-05-26T11:18:57Z","html_url":"https://github.com/art-kosm/homeworks/pull/14#discussion_r31023815","pull_request_url":"https://api.github.com/repos/art-kosm/homeworks/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/art-kosm/homeworks/pulls/comments/31023815"},"html":{"href":"https://github.com/art-kosm/homeworks/pull/14#discussion_r31023815"},"pull_request":{"href":"https://api.github.com/repos/art-kosm/homeworks/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/art-kosm/homeworks/pulls/14","id":36094947,"html_url":"https://github.com/art-kosm/homeworks/pull/14","diff_url":"https://github.com/art-kosm/homeworks/pull/14.diff","patch_url":"https://github.com/art-kosm/homeworks/pull/14.patch","issue_url":"https://api.github.com/repos/art-kosm/homeworks/issues/14","number":14,"state":"open","locked":false,"title":"shared pointer analog implemented","user":{"login":"art-kosm","id":11066513,"avatar_url":"https://avatars.githubusercontent.com/u/11066513?v=3","gravatar_id":"","url":"https://api.github.com/users/art-kosm","html_url":"https://github.com/art-kosm","followers_url":"https://api.github.com/users/art-kosm/followers","following_url":"https://api.github.com/users/art-kosm/following{/other_user}","gists_url":"https://api.github.com/users/art-kosm/gists{/gist_id}","starred_url":"https://api.github.com/users/art-kosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/art-kosm/subscriptions","organizations_url":"https://api.github.com/users/art-kosm/orgs","repos_url":"https://api.github.com/users/art-kosm/repos","events_url":"https://api.github.com/users/art-kosm/events{/privacy}","received_events_url":"https://api.github.com/users/art-kosm/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-23T22:43:50Z","updated_at":"2015-05-26T11:18:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22c7d024df58c204abdeca153ae2fa1035db4f2e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/art-kosm/homeworks/pulls/14/commits","review_comments_url":"https://api.github.com/repos/art-kosm/homeworks/pulls/14/comments","review_comment_url":"https://api.github.com/repos/art-kosm/homeworks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/art-kosm/homeworks/issues/14/comments","statuses_url":"https://api.github.com/repos/art-kosm/homeworks/statuses/0e2cc2c2a449d2e0cc371a7313fced4db4a51a3e","head":{"label":"art-kosm:smart_pointer_7.3","ref":"smart_pointer_7.3","sha":"0e2cc2c2a449d2e0cc371a7313fced4db4a51a3e","user":{"login":"art-kosm","id":11066513,"avatar_url":"https://avatars.githubusercontent.com/u/11066513?v=3","gravatar_id":"","url":"https://api.github.com/users/art-kosm","html_url":"https://github.com/art-kosm","followers_url":"https://api.github.com/users/art-kosm/followers","following_url":"https://api.github.com/users/art-kosm/following{/other_user}","gists_url":"https://api.github.com/users/art-kosm/gists{/gist_id}","starred_url":"https://api.github.com/users/art-kosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/art-kosm/subscriptions","organizations_url":"https://api.github.com/users/art-kosm/orgs","repos_url":"https://api.github.com/users/art-kosm/repos","events_url":"https://api.github.com/users/art-kosm/events{/privacy}","received_events_url":"https://api.github.com/users/art-kosm/received_events","type":"User","site_admin":false},"repo":{"id":31674009,"name":"homeworks","full_name":"art-kosm/homeworks","owner":{"login":"art-kosm","id":11066513,"avatar_url":"https://avatars.githubusercontent.com/u/11066513?v=3","gravatar_id":"","url":"https://api.github.com/users/art-kosm","html_url":"https://github.com/art-kosm","followers_url":"https://api.github.com/users/art-kosm/followers","following_url":"https://api.github.com/users/art-kosm/following{/other_user}","gists_url":"https://api.github.com/users/art-kosm/gists{/gist_id}","starred_url":"https://api.github.com/users/art-kosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/art-kosm/subscriptions","organizations_url":"https://api.github.com/users/art-kosm/orgs","repos_url":"https://api.github.com/users/art-kosm/repos","events_url":"https://api.github.com/users/art-kosm/events{/privacy}","received_events_url":"https://api.github.com/users/art-kosm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/art-kosm/homeworks","description":"","fork":false,"url":"https://api.github.com/repos/art-kosm/homeworks","forks_url":"https://api.github.com/repos/art-kosm/homeworks/forks","keys_url":"https://api.github.com/repos/art-kosm/homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/art-kosm/homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/art-kosm/homeworks/teams","hooks_url":"https://api.github.com/repos/art-kosm/homeworks/hooks","issue_events_url":"https://api.github.com/repos/art-kosm/homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/art-kosm/homeworks/events","assignees_url":"https://api.github.com/repos/art-kosm/homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/art-kosm/homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/art-kosm/homeworks/tags","blobs_url":"https://api.github.com/repos/art-kosm/homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/art-kosm/homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/art-kosm/homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/art-kosm/homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/art-kosm/homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/art-kosm/homeworks/languages","stargazers_url":"https://api.github.com/repos/art-kosm/homeworks/stargazers","contributors_url":"https://api.github.com/repos/art-kosm/homeworks/contributors","subscribers_url":"https://api.github.com/repos/art-kosm/homeworks/subscribers","subscription_url":"https://api.github.com/repos/art-kosm/homeworks/subscription","commits_url":"https://api.github.com/repos/art-kosm/homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/art-kosm/homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/art-kosm/homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/art-kosm/homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/art-kosm/homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/art-kosm/homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/art-kosm/homeworks/merges","archive_url":"https://api.github.com/repos/art-kosm/homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/art-kosm/homeworks/downloads","issues_url":"https://api.github.com/repos/art-kosm/homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/art-kosm/homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/art-kosm/homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/art-kosm/homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/art-kosm/homeworks/labels{/name}","releases_url":"https://api.github.com/repos/art-kosm/homeworks/releases{/id}","created_at":"2015-03-04T18:54:46Z","updated_at":"2015-04-09T14:05:41Z","pushed_at":"2015-05-25T16:55:04Z","git_url":"git://github.com/art-kosm/homeworks.git","ssh_url":"git@github.com:art-kosm/homeworks.git","clone_url":"https://github.com/art-kosm/homeworks.git","svn_url":"https://github.com/art-kosm/homeworks","homepage":null,"size":597,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"art-kosm:master","ref":"master","sha":"727e9fdfab6ec31e86aa73e4e03fbb18cdb6a82e","user":{"login":"art-kosm","id":11066513,"avatar_url":"https://avatars.githubusercontent.com/u/11066513?v=3","gravatar_id":"","url":"https://api.github.com/users/art-kosm","html_url":"https://github.com/art-kosm","followers_url":"https://api.github.com/users/art-kosm/followers","following_url":"https://api.github.com/users/art-kosm/following{/other_user}","gists_url":"https://api.github.com/users/art-kosm/gists{/gist_id}","starred_url":"https://api.github.com/users/art-kosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/art-kosm/subscriptions","organizations_url":"https://api.github.com/users/art-kosm/orgs","repos_url":"https://api.github.com/users/art-kosm/repos","events_url":"https://api.github.com/users/art-kosm/events{/privacy}","received_events_url":"https://api.github.com/users/art-kosm/received_events","type":"User","site_admin":false},"repo":{"id":31674009,"name":"homeworks","full_name":"art-kosm/homeworks","owner":{"login":"art-kosm","id":11066513,"avatar_url":"https://avatars.githubusercontent.com/u/11066513?v=3","gravatar_id":"","url":"https://api.github.com/users/art-kosm","html_url":"https://github.com/art-kosm","followers_url":"https://api.github.com/users/art-kosm/followers","following_url":"https://api.github.com/users/art-kosm/following{/other_user}","gists_url":"https://api.github.com/users/art-kosm/gists{/gist_id}","starred_url":"https://api.github.com/users/art-kosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/art-kosm/subscriptions","organizations_url":"https://api.github.com/users/art-kosm/orgs","repos_url":"https://api.github.com/users/art-kosm/repos","events_url":"https://api.github.com/users/art-kosm/events{/privacy}","received_events_url":"https://api.github.com/users/art-kosm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/art-kosm/homeworks","description":"","fork":false,"url":"https://api.github.com/repos/art-kosm/homeworks","forks_url":"https://api.github.com/repos/art-kosm/homeworks/forks","keys_url":"https://api.github.com/repos/art-kosm/homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/art-kosm/homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/art-kosm/homeworks/teams","hooks_url":"https://api.github.com/repos/art-kosm/homeworks/hooks","issue_events_url":"https://api.github.com/repos/art-kosm/homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/art-kosm/homeworks/events","assignees_url":"https://api.github.com/repos/art-kosm/homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/art-kosm/homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/art-kosm/homeworks/tags","blobs_url":"https://api.github.com/repos/art-kosm/homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/art-kosm/homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/art-kosm/homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/art-kosm/homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/art-kosm/homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/art-kosm/homeworks/languages","stargazers_url":"https://api.github.com/repos/art-kosm/homeworks/stargazers","contributors_url":"https://api.github.com/repos/art-kosm/homeworks/contributors","subscribers_url":"https://api.github.com/repos/art-kosm/homeworks/subscribers","subscription_url":"https://api.github.com/repos/art-kosm/homeworks/subscription","commits_url":"https://api.github.com/repos/art-kosm/homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/art-kosm/homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/art-kosm/homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/art-kosm/homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/art-kosm/homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/art-kosm/homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/art-kosm/homeworks/merges","archive_url":"https://api.github.com/repos/art-kosm/homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/art-kosm/homeworks/downloads","issues_url":"https://api.github.com/repos/art-kosm/homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/art-kosm/homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/art-kosm/homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/art-kosm/homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/art-kosm/homeworks/labels{/name}","releases_url":"https://api.github.com/repos/art-kosm/homeworks/releases{/id}","created_at":"2015-03-04T18:54:46Z","updated_at":"2015-04-09T14:05:41Z","pushed_at":"2015-05-25T16:55:04Z","git_url":"git://github.com/art-kosm/homeworks.git","ssh_url":"git@github.com:art-kosm/homeworks.git","clone_url":"https://github.com/art-kosm/homeworks.git","svn_url":"https://github.com/art-kosm/homeworks","homepage":null,"size":597,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/art-kosm/homeworks/pulls/14"},"html":{"href":"https://github.com/art-kosm/homeworks/pull/14"},"issue":{"href":"https://api.github.com/repos/art-kosm/homeworks/issues/14"},"comments":{"href":"https://api.github.com/repos/art-kosm/homeworks/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/art-kosm/homeworks/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/art-kosm/homeworks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/art-kosm/homeworks/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/art-kosm/homeworks/statuses/0e2cc2c2a449d2e0cc371a7313fced4db4a51a3e"}}}}