Skip to content

Conversation

@Grufoony
Copy link
Collaborator

No description provided.

Func f = streetLength) const;
};

template <typename node_t, typename... TArgs>

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
};

template <typename node_t, typename... TArgs>
requires(std::is_base_of_v<Node, node_t>,

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule

template <typename node_t, typename... TArgs>
requires(std::is_base_of_v<Node, node_t>,
std::constructible_from<node_t, Id, TArgs...>)

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
std::constructible_from<node_t, Id, TArgs...>)
node_t& Graph::addNode(Id id, TArgs&&... args) {
addNode(std::make_unique<node_t>(id, std::forward<TArgs>(args)...));
return dynamic_cast<node_t&>(*m_nodes[id]);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
addNodes(std::forward<Tn>(nodes)...);
}

template <typename edge_t, typename... TArgs>

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
}

template <typename edge_t, typename... TArgs>
requires(std::is_base_of_v<Street, edge_t>,

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule

template <typename edge_t, typename... TArgs>
requires(std::is_base_of_v<Street, edge_t>,
std::constructible_from<edge_t, Id, TArgs...>)

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
std::constructible_from<edge_t, Id, TArgs...>)
edge_t& Graph::addEdge(Id id, TArgs&&... args) {
addStreet(std::make_unique<edge_t>(id, std::forward<TArgs>(args)...));
return dynamic_cast<edge_t&>(*m_streets[id]);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
std::cout << "Benchmarking addNode\n";
Intersection n1(std::rand());
b1.benchmark([&g1](const Intersection& node) -> void { g1.addNode(node); }, n1);
b1.benchmark([&g1]() -> void { g1.addNode<Intersection>(std::rand()); });

Check notice

Code scanning / Cppcheck (reported by Codacy)

Do not use the rand() function for generating pseudorandom numbers Note test

Do not use the rand() function for generating pseudorandom numbers
@Grufoony Grufoony requested a review from sbaldu December 20, 2024 15:09
@Grufoony Grufoony merged commit 8592bb3 into main Dec 20, 2024
25 checks passed
@Grufoony Grufoony deleted the enhance_graphAdders branch December 20, 2024 15:40
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.

2 participants