Remove "using namespace" from headers and make single param constructors explicit
This commit is contained in:
@@ -15,7 +15,7 @@ template<typename T> std::ostream& operator<<(std::ostream& os, Graph<T>& G);
|
||||
template<typename T>
|
||||
class Graph {
|
||||
public:
|
||||
~Graph();
|
||||
virtual ~Graph() = default;
|
||||
|
||||
// Return true if there is a path from u to v
|
||||
virtual bool contains(const T& u, const T& v) =0;
|
||||
@@ -41,11 +41,6 @@ public:
|
||||
friend std::ostream& operator<<<>(std::ostream& os, Graph<T>& G);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
Graph<T>::~Graph() {
|
||||
adjList.clear();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
auto Graph<T>::vertices() {
|
||||
return std::views::keys(adjList);
|
||||
@@ -62,7 +57,7 @@ std::uint16_t Graph<T>::E() {
|
||||
for (const auto& u : vertices()) {
|
||||
edges += static_cast<std::uint16_t>(adjList[u].size());
|
||||
}
|
||||
return static_cast<std::uint16_t>(edges);
|
||||
return edges;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user