From 19dfb6ea1f6745c0dbc2ce21839c30184b553878 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 8 Apr 2021 11:07:12 +0200 Subject: Cleanup: enable modernize-use-equals-default check This removes a lot of unnecessary code that is generated by the compiler automatically. In very few cases, a defaulted destructor in a .cc file is still necessary, because of forward declarations in the header. I removed some defaulted virtual destructors, because they are not necessary, when the parent class has a virtual destructor already. Defaulted constructors are only necessary when there is another constructor, but the class should still be default constructible. Differential Revision: https://developer.blender.org/D10911 --- source/blender/blenlib/intern/delaunay_2d.cc | 3 - source/blender/blenlib/intern/mesh_intersect.cc | 79 +------------------------ source/blender/blenlib/intern/task_pool.cc | 4 -- 3 files changed, 1 insertion(+), 85 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc index 06a749ab921..9444d1a29cb 100644 --- a/source/blender/blenlib/intern/delaunay_2d.cc +++ b/source/blender/blenlib/intern/delaunay_2d.cc @@ -334,9 +334,6 @@ template class CDT_state { T epsilon; explicit CDT_state(int num_input_verts, int num_input_edges, int num_input_faces, T epsilon); - ~CDT_state() - { - } }; template CDTArrangement::~CDTArrangement() diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index b2b8dd4e900..ce3a5b55f98 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -527,9 +527,7 @@ IMeshArena::IMeshArena() pimpl_ = std::make_unique(); } -IMeshArena::~IMeshArena() -{ -} +IMeshArena::~IMeshArena() = default; void IMeshArena::reserve(int vert_num_hint, int face_num_hint) { @@ -753,27 +751,6 @@ struct BoundingBox { BoundingBox(const float3 &min, const float3 &max) : min(min), max(max) { } - BoundingBox(const BoundingBox &other) : min(other.min), max(other.max) - { - } - BoundingBox(BoundingBox &&other) noexcept : min(std::move(other.min)), max(std::move(other.max)) - { - } - ~BoundingBox() = default; - BoundingBox operator=(const BoundingBox &other) - { - if (this != &other) { - min = other.min; - max = other.max; - } - return *this; - } - BoundingBox operator=(BoundingBox &&other) noexcept - { - min = std::move(other.min); - max = std::move(other.max); - return *this; - } void combine(const float3 &p) { @@ -936,28 +913,6 @@ class CoplanarCluster { { this->add_tri(t, bb); } - CoplanarCluster(const CoplanarCluster &other) : tris_(other.tris_), bb_(other.bb_) - { - } - CoplanarCluster(CoplanarCluster &&other) noexcept - : tris_(std::move(other.tris_)), bb_(std::move(other.bb_)) - { - } - ~CoplanarCluster() = default; - CoplanarCluster &operator=(const CoplanarCluster &other) - { - if (this != &other) { - tris_ = other.tris_; - bb_ = other.bb_; - } - return *this; - } - CoplanarCluster &operator=(CoplanarCluster &&other) noexcept - { - tris_ = std::move(other.tris_); - bb_ = std::move(other.bb_); - return *this; - } /* Assume that caller knows this will not be a duplicate. */ void add_tri(int t, const BoundingBox &bb) @@ -1073,38 +1028,6 @@ struct ITT_value { ITT_value(ITT_value_kind k, const mpq3 &p1, const mpq3 &p2) : p1(p1), p2(p2), kind(k) { } - ITT_value(const ITT_value &other) - : p1(other.p1), p2(other.p2), t_source(other.t_source), kind(other.kind) - { - } - ITT_value(ITT_value &&other) noexcept - : p1(std::move(other.p1)), - p2(std::move(other.p2)), - t_source(other.t_source), - kind(other.kind) - { - } - ~ITT_value() - { - } - ITT_value &operator=(const ITT_value &other) - { - if (this != &other) { - kind = other.kind; - p1 = other.p1; - p2 = other.p2; - t_source = other.t_source; - } - return *this; - } - ITT_value &operator=(ITT_value &&other) noexcept - { - kind = other.kind; - p1 = std::move(other.p1); - p2 = std::move(other.p2); - t_source = other.t_source; - return *this; - } }; static std::ostream &operator<<(std::ostream &os, const ITT_value &itt); diff --git a/source/blender/blenlib/intern/task_pool.cc b/source/blender/blenlib/intern/task_pool.cc index 00ba659a9c8..6404f5264cc 100644 --- a/source/blender/blenlib/intern/task_pool.cc +++ b/source/blender/blenlib/intern/task_pool.cc @@ -147,10 +147,6 @@ class TBBTaskGroup : public tbb::task_group { } # endif } - - ~TBBTaskGroup() - { - } }; #endif -- cgit v1.2.3