Skip to content

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

Stargazer2005
Copy link

No description provided.

Copy link

@github-actions github-actions bot left a 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"
Copy link

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 };
Copy link

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)
Copy link

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;
Copy link

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>
Copy link

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]

Suggested change
requires IsVertex<VertexType, T>
requires IsVertex<VertexType, T>;

* @param data
*/
virtual void AddVertex(const T &data) {
vertices_.push_back(std::make_shared<VertexType>(data));
Copy link

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) {
Copy link

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 {
Copy link

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 {
Copy link

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) {
Copy link

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) {
                                            ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant