Rusanov Anton, homework - #22
Conversation
| @@ -1,8 +1,90 @@ | |||
|
|
|||
| #include <gtest/gtest.h> | |||
There was a problem hiding this comment.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^| void Graph::countIncoming() { | ||
| for (auto& elem : nodes) { | ||
| for (size_t j = 0; j < elem.second.out.size(); ++j) { | ||
| size_t cur_number = nodes[elem.first].out[j]; |
There was a problem hiding this comment.
warning: variable 'cur_number' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
| size_t cur_number = nodes[elem.first].out[j]; | |
| size_t const cur_number = nodes[elem.first].out[j]; |
| for (auto& elem : graph.nodes) | ||
| if (elem.second.in == 0) zeros.push(elem.first); | ||
| while (zeros.size() != 0) { | ||
| size_t x = zeros.front(); |
There was a problem hiding this comment.
warning: variable 'x' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
| size_t x = zeros.front(); | |
| size_t const x = zeros.front(); |
| #pragma once | ||
| #include <unordered_map> | ||
| #include <vector> | ||
| struct Node { |
There was a problem hiding this comment.
warning: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init]
task_01/src/topology_sort.hpp:4:
- size_t id;
+ size_t id{};| #include <unordered_map> | ||
| #include <vector> | ||
| struct Node { | ||
| size_t id; |
There was a problem hiding this comment.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
| size_t id; | |
| std::size_t id; |
Additional context
/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^| @@ -1,6 +1,41 @@ | |||
|
|
|||
| #include <gtest/gtest.h> | |||
There was a problem hiding this comment.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^| #include <unordered_map> | ||
| #include <vector> | ||
| struct Edge { | ||
| size_t weight; |
There was a problem hiding this comment.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
| size_t weight; | |
| std::size_t weight; |
Additional context
/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^| #include <vector> | ||
| struct Edge { | ||
| size_t weight; | ||
| size_t index_to; |
There was a problem hiding this comment.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
| size_t index_to; | |
| std::size_t index_to; |
Additional context
/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^| struct Edge { | ||
| size_t weight; | ||
| size_t index_to; | ||
| Edge(size_t index_to, size_t weight) : weight(weight), index_to(index_to) {} |
There was a problem hiding this comment.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
| Edge(size_t index_to, size_t weight) : weight(weight), index_to(index_to) {} | |
| Edge(std::size_t index_to, size_t weight) : weight(weight), index_to(index_to) {} |
Additional context
/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^| struct Edge { | ||
| size_t weight; | ||
| size_t index_to; | ||
| Edge(size_t index_to, size_t weight) : weight(weight), index_to(index_to) {} |
There was a problem hiding this comment.
warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]
| Edge(size_t index_to, size_t weight) : weight(weight), index_to(index_to) {} | |
| Edge(size_t index_to, std::size_t weight) : weight(weight), index_to(index_to) {} |
Additional context
/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here
typedef __SIZE_TYPE__ size_t;
^
No description provided.