-
Notifications
You must be signed in to change notification settings - Fork 23
Merge users (additional task) #28
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?
Merge users (additional task) #28
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
There were too many comments to post at once. Showing the first 15 out of 25. Check the log or trigger a new build to see more.
#include <string> | ||
#include <vector> | ||
|
||
#include "graph.hpp" |
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: 'graph.hpp' file not found [clang-diagnostic-error]
#include "graph.hpp"
^
#include "graph.hpp" | ||
|
||
/// @brief Type of user data | ||
enum Type { Name, Email }; |
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: enum 'Type' uses a larger base type ('unsigned int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum Type { Name, Email };
^
|
||
/// @brief User with a name and email | ||
struct User { | ||
User(const std::string& name, const std::set<std::string>& emails) |
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: constructor does not initialize these fields: emails [cppcoreguidelines-pro-type-member-init]
additional_tasks/merge_users/src/merge_users.hpp:31:
- std::set<std::string> emails; // set to avoid duplicates
+ std::set<std::string> emails{}; // set to avoid duplicates
}; | ||
|
||
template <typename T, typename VT> | ||
concept IsVertex = std::is_base_of<Vertex<VT>, T>::value; |
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: unknown type name 'concept' [clang-diagnostic-error]
concept IsVertex = std::is_base_of<Vertex<VT>, T>::value;
^
/// @tparam VertexType | ||
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> |
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: expected ';' at end of declaration [clang-diagnostic-error]
requires IsVertex<VertexType, T> | |
requires IsVertex<VertexType, T>; |
* @param data | ||
*/ | ||
virtual void AddVertex(const T &data) { | ||
vertices_.push_back(std::make_shared<VertexType>(data)); |
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 of undeclared identifier 'VertexType' [clang-diagnostic-error]
vertices_.push_back(std::make_shared<VertexType>(data));
^
vertices_.push_back(std::make_shared<VertexType>(data)); | ||
}; | ||
|
||
std::shared_ptr<VertexType> operator[](size_t index) { |
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 of undeclared identifier 'VertexType' [clang-diagnostic-error]
std::shared_ptr<VertexType> operator[](size_t index) {
^
return vertices_[index]; | ||
} | ||
|
||
const std::shared_ptr<VertexType> operator[](size_t index) const { |
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 of undeclared identifier 'VertexType' [clang-diagnostic-error]
const std::shared_ptr<VertexType> operator[](size_t index) const {
^
* @param vertex | ||
* @return size_t | ||
*/ | ||
size_t Find(const T &vertex) const { |
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: unknown type name 'T' [clang-diagnostic-error]
size_t Find(const T &vertex) const {
^
* Remove a vertex from the graph | ||
* @param vertex | ||
*/ | ||
virtual void RemoveVertex(std::shared_ptr<VertexType> vertex) { |
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 of undeclared identifier 'VertexType' [clang-diagnostic-error]
virtual void RemoveVertex(std::shared_ptr<VertexType> vertex) {
^
No description provided.