diff options
author | Jacques Lucke <jacques@blender.org> | 2021-04-08 12:07:12 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-04-08 12:07:27 +0300 |
commit | 19dfb6ea1f6745c0dbc2ce21839c30184b553878 (patch) | |
tree | 4deac8e505cf2f422ab20d132395d006dddb29c3 /source/blender/blenlib/intern | |
parent | 0ea66039dd5374e23e9e60e8e3192f919d4f1abd (diff) |
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
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/delaunay_2d.cc | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/mesh_intersect.cc | 79 | ||||
-rw-r--r-- | source/blender/blenlib/intern/task_pool.cc | 4 |
3 files changed, 1 insertions, 85 deletions
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<typename T> 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<typename T> CDTArrangement<T>::~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<IMeshArenaImpl>(); } -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 |