-
Notifications
You must be signed in to change notification settings - Fork 23
Homework #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Homework #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -0,0 +1,126 @@ | |||
#ifndef __GRAPH_H__ | |||
#define __GRAPH_H__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: declaration uses identifier 'GRAPH_H', which is a reserved identifier [bugprone-reserved-identifier]
#define __GRAPH_H__ | |
#define GRAPH_H_ |
|
||
template<typename T, typename NameType> | ||
class Graph { | ||
static_assert(std::is_arithmetic<T>::value, "Graph: paths' lenghts must be arithmetic!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::is_arithmetic" is directly included [misc-include-cleaner]
lib/src/graph.cpp:3:
- #include <unordered_map>
+ #include <type_traits>
+ #include <unordered_map>
public: | ||
node(NameType name) : name{name}, paths{} {} | ||
NameType name{NameType()}; | ||
std::unordered_map<node*, T> paths; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use default member initializer for 'paths' [cppcoreguidelines-use-default-member-init]
lib/src/graph.cpp:14:
- node(NameType name) : name{name}, paths{} {}
+ node(NameType name) : name{name}, {}
std::unordered_map<node*, T> paths; | |
std::unordered_map<node*, T> paths{}; |
|
||
public: | ||
|
||
Graph(std::initializer_list<std::pair<NameType, NameType>> links, T base_lenght = 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "std::pair" is directly included [misc-include-cleaner]
lib/src/graph.cpp:4:
- #include <vector>
+ #include <utility>
+ #include <vector>
@@ -0,0 +1 @@ | |||
#include <stack> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: included header stack is not used directly [misc-include-cleaner]
#include <stack> | |
> |
No description provided.