{"action":"created","comment":{"url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/comments/222957319","pull_request_review_id":161971039,"id":222957319,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjk1NzMxOQ==","diff_hunk":"@@ -0,0 +1,201 @@\n+#pragma once\n+/*\n+����������� ���� ���������, ������� �� �������� � ������������ stl\n+��������������� �����������. ��������� ������ ����� ��� �����������\n+- �������� ����� ������� � ������ ��������� � ����� �����������.\n+������������� � ������������ stl �� ���������� ������.\n+*/\n+#include <memory>\n+\n+/*-----------------------------------------------------------------------------*/\n+/*\n+\t��������������� ����� ����� ������\n+*/\n+template <typename T>\n+class Node\n+{\n+public:\n+\tNode();\n+\t~Node();\n+\tNode<T>* getNextNode() { return ptrNextNode; };\n+\tvoid setNextNode(Node<T>* pNextNode) { ptrNextNode = pNextNode; };\n+\tNode<T>* getPrevNode() { return ptrPrevNode; };\n+\tvoid setPrevNode(Node<T>* pPrevNode) { ptrPrevNode = pPrevNode; };\n+\n+\tT& getValue() { return value; };\n+\tvoid setValue(T new_value) { value = new_value; };\n+private:\n+\tNode<T>* ptrNextNode = nullptr;\n+\tNode<T>* ptrPrevNode = nullptr;\n+\tT value;\n+};\n+\n+template<typename T>\n+Node<T>::Node() : ptrNextNode(nullptr), ptrPrevNode(nullptr)\n+{\n+}\n+\n+template<typename T>\n+Node<T>::~Node()\n+{\n+}\n+\n+/*-----------------------------------------------------------------------------*/\n+/*\n+\t���������� ��������� - ��������������� ������\n+*/\n+template <typename T, typename Alloc = std::allocator<Node<T>>>\n+class my_list\n+{\n+\tusing my_node = Node<T>;\n+\tusing my_nodeptr = Node<T>*;\n+\n+public:\n+\tmy_list();\n+\t~my_list();\n+\n+\tT getValue(size_t index);\n+\tbool insert(const T value);\n+\tbool remove(size_t index);\n+\n+\tAlloc& getAlloc() { return my_list_allocator; };\n+\tsize_t size() { return mSize; };\n+\n+private:\n+\tmy_nodeptr head;\n+\tmy_nodeptr tail;\n+\n+\tAlloc my_list_allocator;\n+\t\n+\tsize_t mSize;\n+\n+\tmy_nodeptr createNode()\n+\t{\n+\t\tmy_nodeptr newNode = getAlloc().allocate(1);\n+\t\tmy_nodeptr nextNode = std::move(newNode->getNextNode());\n+\t\tmy_nodeptr prevNode = std::move(newNode->getPrevNode());\n+\n+\t\tgetAlloc().construct(&newNode, newNode);\n+\t\tgetAlloc().construct(&nextNode, newNode);\n+\t\tgetAlloc().construct(&prevNode, newNode);\n+\t\n+\t\tnewNode->setNextNode(nextNode);\n+\t\tnewNode->setPrevNode(prevNode);\n+\n+\t\treturn newNode;\n+\t};\n+\n+\tvoid clearAll();\n+\tvoid freeNode(my_nodeptr node);\n+\n+\tvoid incSize() { ++mSize; };\n+\tvoid decSize() { --mSize; };\n+\tvoid setTail(my_nodeptr node) { tail = node; };\n+\tvoid setHead(my_nodeptr node) { head = node; };\n+};\n+\n+template<typename T, typename Alloc>\n+my_list<T, Alloc>::my_list() : mSize(0), tail(nullptr)\n+{\n+\tsetHead( createNode() );\n+}\n+\n+template<typename T, typename Alloc>\n+my_list<T, Alloc>::~my_list()\n+{\n+\t// TODO: ��������� �������� ��������� ������ � ������������ ������.\n+\tclearAll();\n+}\n+\n+template<typename T, typename Alloc>\n+T my_list<T, Alloc>::getValue(size_t index)\n+{\n+\tif (index > mSize || index < 0)\n+\t\treturn -1;","path":"my_list.cpp","position":114,"original_position":114,"commit_id":"d756919062d6c4f3ad8d002081e1c9c4d65ff6ee","original_commit_id":"d756919062d6c4f3ad8d002081e1c9c4d65ff6ee","user":{"login":"mkvdv","id":22629087,"node_id":"MDQ6VXNlcjIyNjI5MDg3","avatar_url":"https://avatars1.githubusercontent.com/u/22629087?v=4","gravatar_id":"","url":"https://api.github.com/users/mkvdv","html_url":"https://github.com/mkvdv","followers_url":"https://api.github.com/users/mkvdv/followers","following_url":"https://api.github.com/users/mkvdv/following{/other_user}","gists_url":"https://api.github.com/users/mkvdv/gists{/gist_id}","starred_url":"https://api.github.com/users/mkvdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkvdv/subscriptions","organizations_url":"https://api.github.com/users/mkvdv/orgs","repos_url":"https://api.github.com/users/mkvdv/repos","events_url":"https://api.github.com/users/mkvdv/events{/privacy}","received_events_url":"https://api.github.com/users/mkvdv/received_events","type":"User","site_admin":false},"body":"Возможно, можно кидать исключение, а можно падать по assert, а может возвращать код ошибки, а не `T`\r\nНо тут проблема особенно в том, что вы не сможете такой код скомпилровать, если тип T не int. А класс шаблонный. ","created_at":"2018-10-05T10:12:07Z","updated_at":"2018-10-05T10:12:07Z","html_url":"https://github.com/AIGregor/OTUS-HW-ALLOC/pull/2#discussion_r222957319","pull_request_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/comments/222957319"},"html":{"href":"https://github.com/AIGregor/OTUS-HW-ALLOC/pull/2#discussion_r222957319"},"pull_request":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/2"}},"in_reply_to_id":221431461},"pull_request":{"url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/2","id":216015155,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MDE1MTU1","html_url":"https://github.com/AIGregor/OTUS-HW-ALLOC/pull/2","diff_url":"https://github.com/AIGregor/OTUS-HW-ALLOC/pull/2.diff","patch_url":"https://github.com/AIGregor/OTUS-HW-ALLOC/pull/2.patch","issue_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues/2","number":2,"state":"open","locked":false,"title":"Review2. ДЗ-03 Allocator.","user":{"login":"AIGregor","id":16133002,"node_id":"MDQ6VXNlcjE2MTMzMDAy","avatar_url":"https://avatars0.githubusercontent.com/u/16133002?v=4","gravatar_id":"","url":"https://api.github.com/users/AIGregor","html_url":"https://github.com/AIGregor","followers_url":"https://api.github.com/users/AIGregor/followers","following_url":"https://api.github.com/users/AIGregor/following{/other_user}","gists_url":"https://api.github.com/users/AIGregor/gists{/gist_id}","starred_url":"https://api.github.com/users/AIGregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AIGregor/subscriptions","organizations_url":"https://api.github.com/users/AIGregor/orgs","repos_url":"https://api.github.com/users/AIGregor/repos","events_url":"https://api.github.com/users/AIGregor/events{/privacy}","received_events_url":"https://api.github.com/users/AIGregor/received_events","type":"User","site_admin":false},"body":"Create new review2 for task ДЗ-03 Allocator.","created_at":"2018-09-17T15:05:46Z","updated_at":"2018-10-05T10:12:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98bad9d91c55f692ff871fc2004aa7c3f8a85689","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/2/commits","review_comments_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/2/comments","review_comment_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues/2/comments","statuses_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/statuses/d756919062d6c4f3ad8d002081e1c9c4d65ff6ee","head":{"label":"AIGregor:review2","ref":"review2","sha":"d756919062d6c4f3ad8d002081e1c9c4d65ff6ee","user":{"login":"AIGregor","id":16133002,"node_id":"MDQ6VXNlcjE2MTMzMDAy","avatar_url":"https://avatars0.githubusercontent.com/u/16133002?v=4","gravatar_id":"","url":"https://api.github.com/users/AIGregor","html_url":"https://github.com/AIGregor","followers_url":"https://api.github.com/users/AIGregor/followers","following_url":"https://api.github.com/users/AIGregor/following{/other_user}","gists_url":"https://api.github.com/users/AIGregor/gists{/gist_id}","starred_url":"https://api.github.com/users/AIGregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AIGregor/subscriptions","organizations_url":"https://api.github.com/users/AIGregor/orgs","repos_url":"https://api.github.com/users/AIGregor/repos","events_url":"https://api.github.com/users/AIGregor/events{/privacy}","received_events_url":"https://api.github.com/users/AIGregor/received_events","type":"User","site_admin":false},"repo":{"id":142570259,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI1NzAyNTk=","name":"OTUS-HW-ALLOC","full_name":"AIGregor/OTUS-HW-ALLOC","private":false,"owner":{"login":"AIGregor","id":16133002,"node_id":"MDQ6VXNlcjE2MTMzMDAy","avatar_url":"https://avatars0.githubusercontent.com/u/16133002?v=4","gravatar_id":"","url":"https://api.github.com/users/AIGregor","html_url":"https://github.com/AIGregor","followers_url":"https://api.github.com/users/AIGregor/followers","following_url":"https://api.github.com/users/AIGregor/following{/other_user}","gists_url":"https://api.github.com/users/AIGregor/gists{/gist_id}","starred_url":"https://api.github.com/users/AIGregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AIGregor/subscriptions","organizations_url":"https://api.github.com/users/AIGregor/orgs","repos_url":"https://api.github.com/users/AIGregor/repos","events_url":"https://api.github.com/users/AIGregor/events{/privacy}","received_events_url":"https://api.github.com/users/AIGregor/received_events","type":"User","site_admin":false},"html_url":"https://github.com/AIGregor/OTUS-HW-ALLOC","description":null,"fork":false,"url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC","forks_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/forks","keys_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/teams","hooks_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/hooks","issue_events_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues/events{/number}","events_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/events","assignees_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/assignees{/user}","branches_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/branches{/branch}","tags_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/tags","blobs_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/refs{/sha}","trees_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/statuses/{sha}","languages_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/languages","stargazers_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/stargazers","contributors_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/contributors","subscribers_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/subscribers","subscription_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/subscription","commits_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/commits{/sha}","git_commits_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/commits{/sha}","comments_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/comments{/number}","issue_comment_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues/comments{/number}","contents_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/contents/{+path}","compare_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/merges","archive_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/downloads","issues_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues{/number}","pulls_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls{/number}","milestones_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/milestones{/number}","notifications_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/labels{/name}","releases_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/releases{/id}","deployments_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/deployments","created_at":"2018-07-27T11:43:24Z","updated_at":"2018-09-17T14:52:40Z","pushed_at":"2018-09-17T15:05:47Z","git_url":"git://github.com/AIGregor/OTUS-HW-ALLOC.git","ssh_url":"git@github.com:AIGregor/OTUS-HW-ALLOC.git","clone_url":"https://github.com/AIGregor/OTUS-HW-ALLOC.git","svn_url":"https://github.com/AIGregor/OTUS-HW-ALLOC","homepage":null,"size":39,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"AIGregor:master","ref":"master","sha":"e505bb36898f2fd0b00811677b44454bf1a5ddd2","user":{"login":"AIGregor","id":16133002,"node_id":"MDQ6VXNlcjE2MTMzMDAy","avatar_url":"https://avatars0.githubusercontent.com/u/16133002?v=4","gravatar_id":"","url":"https://api.github.com/users/AIGregor","html_url":"https://github.com/AIGregor","followers_url":"https://api.github.com/users/AIGregor/followers","following_url":"https://api.github.com/users/AIGregor/following{/other_user}","gists_url":"https://api.github.com/users/AIGregor/gists{/gist_id}","starred_url":"https://api.github.com/users/AIGregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AIGregor/subscriptions","organizations_url":"https://api.github.com/users/AIGregor/orgs","repos_url":"https://api.github.com/users/AIGregor/repos","events_url":"https://api.github.com/users/AIGregor/events{/privacy}","received_events_url":"https://api.github.com/users/AIGregor/received_events","type":"User","site_admin":false},"repo":{"id":142570259,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI1NzAyNTk=","name":"OTUS-HW-ALLOC","full_name":"AIGregor/OTUS-HW-ALLOC","private":false,"owner":{"login":"AIGregor","id":16133002,"node_id":"MDQ6VXNlcjE2MTMzMDAy","avatar_url":"https://avatars0.githubusercontent.com/u/16133002?v=4","gravatar_id":"","url":"https://api.github.com/users/AIGregor","html_url":"https://github.com/AIGregor","followers_url":"https://api.github.com/users/AIGregor/followers","following_url":"https://api.github.com/users/AIGregor/following{/other_user}","gists_url":"https://api.github.com/users/AIGregor/gists{/gist_id}","starred_url":"https://api.github.com/users/AIGregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AIGregor/subscriptions","organizations_url":"https://api.github.com/users/AIGregor/orgs","repos_url":"https://api.github.com/users/AIGregor/repos","events_url":"https://api.github.com/users/AIGregor/events{/privacy}","received_events_url":"https://api.github.com/users/AIGregor/received_events","type":"User","site_admin":false},"html_url":"https://github.com/AIGregor/OTUS-HW-ALLOC","description":null,"fork":false,"url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC","forks_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/forks","keys_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/teams","hooks_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/hooks","issue_events_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues/events{/number}","events_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/events","assignees_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/assignees{/user}","branches_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/branches{/branch}","tags_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/tags","blobs_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/refs{/sha}","trees_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/statuses/{sha}","languages_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/languages","stargazers_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/stargazers","contributors_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/contributors","subscribers_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/subscribers","subscription_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/subscription","commits_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/commits{/sha}","git_commits_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/git/commits{/sha}","comments_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/comments{/number}","issue_comment_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues/comments{/number}","contents_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/contents/{+path}","compare_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/merges","archive_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/downloads","issues_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues{/number}","pulls_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls{/number}","milestones_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/milestones{/number}","notifications_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/labels{/name}","releases_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/releases{/id}","deployments_url":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/deployments","created_at":"2018-07-27T11:43:24Z","updated_at":"2018-09-17T14:52:40Z","pushed_at":"2018-09-17T15:05:47Z","git_url":"git://github.com/AIGregor/OTUS-HW-ALLOC.git","ssh_url":"git@github.com:AIGregor/OTUS-HW-ALLOC.git","clone_url":"https://github.com/AIGregor/OTUS-HW-ALLOC.git","svn_url":"https://github.com/AIGregor/OTUS-HW-ALLOC","homepage":null,"size":39,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/2"},"html":{"href":"https://github.com/AIGregor/OTUS-HW-ALLOC/pull/2"},"issue":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues/2"},"comments":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/AIGregor/OTUS-HW-ALLOC/statuses/d756919062d6c4f3ad8d002081e1c9c4d65ff6ee"}},"author_association":"OWNER"}}
{"actor":{"display_login":"mkvdv"}}