Skip to content

Commit b3c24b2

Browse files
authored
Merge pull request #3063 from sakirr05/fix/cppcoreguidelines-explicit-virtual-functions-3045
clang-tidy: fix explicit virtual functions in remaining headers
2 parents 54c13c8 + 5d455e1 commit b3c24b2

6 files changed

Lines changed: 12 additions & 13 deletions

File tree

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Checks: >
1111
-cppcoreguidelines-avoid-const-or-ref-data-members,
1212
-cppcoreguidelines-avoid-do-while,
1313
-cppcoreguidelines-avoid-magic-numbers,
14-
-cppcoreguidelines-explicit-virtual-functions,
1514
-cppcoreguidelines-macro-usage,
1615
-cppcoreguidelines-narrowing-conversions,
1716
-cppcoreguidelines-no-malloc,

include/bdAstar/bdAstar.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Pgr_bdAstar : public Pgr_bidirectional<G> {
7878
m_log << "pgr_bdAstar constructor\n";
7979
}
8080

81-
virtual ~Pgr_bdAstar() = default;
81+
~Pgr_bdAstar() override = default;
8282

8383
Path pgr_bdAstar(V start_vertex, V end_vertex,
8484
int heuristic,
@@ -98,7 +98,7 @@ class Pgr_bdAstar : public Pgr_bidirectional<G> {
9898
using Pgr_bidirectional<G>::clean_log;
9999

100100
private:
101-
void explore_forward(const Cost_Vertex_pair &node) {
101+
void explore_forward(const Cost_Vertex_pair &node) override {
102102
typename G::EO_i out, out_end;
103103

104104
auto current_node = node.second;
@@ -124,7 +124,7 @@ class Pgr_bdAstar : public Pgr_bidirectional<G> {
124124
forward_finished[current_node] = true;
125125
}
126126

127-
void explore_backward(const Cost_Vertex_pair &node) {
127+
void explore_backward(const Cost_Vertex_pair &node) override {
128128
typename G::EI_i in, in_end;
129129

130130
auto current_cost = node.first;

include/bdDijkstra/bdDijkstra.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Pgr_bdDijkstra : public Pgr_bidirectional<G> {
8080
m_log << "pgr_bdDijkstra constructor\n";
8181
}
8282

83-
virtual ~Pgr_bdDijkstra() = default;
83+
~Pgr_bdDijkstra() override = default;
8484

8585
Path pgr_bdDijkstra(V start_vertex, V end_vertex, bool only_cost) {
8686
m_log << "pgr_bdDijkstra\n";
@@ -96,7 +96,7 @@ class Pgr_bdDijkstra : public Pgr_bidirectional<G> {
9696

9797

9898
private:
99-
void explore_forward(const Cost_Vertex_pair &node) {
99+
void explore_forward(const Cost_Vertex_pair &node) override {
100100
typename G::EO_i out, out_end;
101101

102102
auto current_cost = node.first;
@@ -119,7 +119,7 @@ class Pgr_bdDijkstra : public Pgr_bidirectional<G> {
119119
forward_finished[current_node] = true;
120120
}
121121

122-
void explore_backward(const Cost_Vertex_pair &node) {
122+
void explore_backward(const Cost_Vertex_pair &node) override {
123123
typename G::EI_i in, in_end;
124124

125125
auto current_cost = node.first;

include/spanningTree/kruskal.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace functions {
4242
template <class G>
4343
class Pgr_kruskal : public Pgr_mst<G> {
4444
public:
45-
virtual ~Pgr_kruskal() = default;
45+
~Pgr_kruskal() override = default;
4646
std::vector<MST_rt> kruskal(G &graph);
4747

4848
std::vector<MST_rt> kruskalBFS(
@@ -66,7 +66,7 @@ class Pgr_kruskal : public Pgr_mst<G> {
6666
typedef typename G::E E;
6767

6868
/* Does all the work */
69-
void generate_mst(const G &graph);
69+
void generate_mst(const G &graph) override;
7070
};
7171

7272

include/spanningTree/prim.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Pgr_prim : public Pgr_mst<G> {
5151
typedef typename G::B_G B_G;
5252

5353
public:
54-
virtual ~Pgr_prim() = default;
54+
~Pgr_prim() override = default;
5555
std::vector<MST_rt> prim(G &graph);
5656

5757
std::vector<MST_rt> primBFS(
@@ -82,7 +82,7 @@ class Pgr_prim : public Pgr_mst<G> {
8282
const G &graph,
8383
int64_t root_vertex);
8484

85-
void generate_mst(const G &graph);
85+
void generate_mst(const G &graph) override;
8686

8787
private:
8888
// Member

include/yen/turnRestrictedPath.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Pgr_turnRestrictedPath : public Pgr_ksp< G > {
6666
m_restrictions(restrictions) {
6767
}
6868

69-
void on_insert_first_solution(const Path path) const {
69+
void on_insert_first_solution(const Path path) const override {
7070
if (path.empty()) return;
7171
if (has_restriction(path)) return;
7272

@@ -75,7 +75,7 @@ class Pgr_turnRestrictedPath : public Pgr_ksp< G > {
7575
if (m_stop_on_first) throw found_goals();
7676
}
7777

78-
void on_insert_to_heap(const Path path) const {
78+
void on_insert_to_heap(const Path path) const override {
7979
if (path.empty()) return;
8080
if (has_restriction(path)) return;
8181

0 commit comments

Comments
 (0)