Skip to content

Commit 949f89e

Browse files
committed
clang-tidy: check and fix cppcoreguidelines-special-member-functions
1 parent 6d603dc commit 949f89e

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Checks: >
2525
-cppcoreguidelines-pro-type-union-access,
2626
-cppcoreguidelines-pro-type-vararg,
2727
-cppcoreguidelines-slicing,
28-
-cppcoreguidelines-special-member-functions,
2928
-cppcoreguidelines-use-default-member-init
3029
3130
CheckOptions:

include/chinese/chinesePostman.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ namespace graph {
5151
class PgrDirectedChPPGraph {
5252
public:
5353
explicit PgrDirectedChPPGraph(const std::vector<Edge_t>&);
54+
PgrDirectedChPPGraph(const PgrDirectedChPPGraph&) = delete;
55+
PgrDirectedChPPGraph& operator=(const PgrDirectedChPPGraph&) = delete;
5456

5557
double DirectedChPP() const {
5658
return m_cost;

include/cpp_common/line_vertex.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class Line_vertex {
6262
target(v.target),
6363
cost(v.cost) {}
6464

65+
Line_vertex& operator=(const Line_vertex&) = default;
66+
~Line_vertex() = default;
67+
6568
void cp_members(const Line_vertex &other) {
6669
this->id = other.id;
6770
this->vertex_id = other.vertex_id;

include/vrp/solution.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ class Solution {
7979
return *this;
8080
};
8181

82+
/* @brief destructor */
83+
~Solution() = default;
84+
8285

8386
Initials_code get_kind() const;
8487

include/withPoints/withPoints.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class Pg_points_graph : public Pgr_messages {
5050
public:
5151
Pg_points_graph() = delete;
5252
Pg_points_graph(const Pg_points_graph &) = delete;
53+
Pg_points_graph& operator=(const Pg_points_graph&) = delete;
54+
~Pg_points_graph() = default;
5355
Pg_points_graph(
5456
std::vector<Point_on_edge_t> p_points,
5557
std::vector<Edge_t> p_edges_to_modify,

include/yen/ksp.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class Pgr_ksp : public Pgr_messages {
6565
m_heap_paths(false),
6666
m_vis(new Visitor) {
6767
}
68+
Pgr_ksp(const Pgr_ksp&) = delete;
69+
Pgr_ksp& operator=(const Pgr_ksp&) = delete;
6870
~Pgr_ksp() {
6971
delete m_vis;
7072
}
@@ -121,6 +123,9 @@ class Pgr_ksp : public Pgr_messages {
121123

122124
class Visitor {
123125
public:
126+
Visitor() = default;
127+
Visitor(const Visitor&) = delete;
128+
Visitor& operator=(const Visitor&) = delete;
124129
virtual ~Visitor() {}
125130

126131
virtual void on_insert_first_solution(const Path) const {

0 commit comments

Comments
 (0)