From 932fc4596f3916c36034447c0454bc7c6fb0c981 Mon Sep 17 00:00:00 2001 From: JCrawfy Date: Sun, 1 Mar 2020 23:16:57 +1300 Subject: [PATCH] remove declarations of copy/assignment operators that only do default work user defined copy operators suppress compiler creation of move operations, and not having all of copy/move/dtor defined (rule of 0/5) is suspicious. Also happens to be very slightly slower --- include/xlnt/cell/index_types.hpp | 15 --------------- include/xlnt/worksheet/range_reference.hpp | 2 -- source/cell/index_types.cpp | 16 ---------------- source/worksheet/range_reference.cpp | 6 ------ 4 files changed, 39 deletions(-) diff --git a/include/xlnt/cell/index_types.hpp b/include/xlnt/cell/index_types.hpp index 2c14a0e0..1834d92e 100644 --- a/include/xlnt/cell/index_types.hpp +++ b/include/xlnt/cell/index_types.hpp @@ -92,26 +92,11 @@ public: /// column_t(const char *column_string); - /// - /// Copy constructor. Constructs a column by copying it from other. - /// - column_t(const column_t &other); - - /// - /// Move constructor. Constructs a column by moving it from other. - /// - column_t(column_t &&other); - /// /// Returns a string representation of this column index. /// std::string column_string() const; - /// - /// Sets this column to be the same as rhs's and return reference to self. - /// - column_t &operator=(column_t rhs); - /// /// Sets this column to be equal to rhs and return reference to self. /// diff --git a/include/xlnt/worksheet/range_reference.hpp b/include/xlnt/worksheet/range_reference.hpp index 76ba94cf..9e12638d 100644 --- a/include/xlnt/worksheet/range_reference.hpp +++ b/include/xlnt/worksheet/range_reference.hpp @@ -69,8 +69,6 @@ public: range_reference(column_t column_index_start, row_t row_index_start, column_t column_index_end, row_t row_index_end); - range_reference(const range_reference &ref); - /// /// Returns true if the range has a width and height of 1 cell. /// diff --git a/source/cell/index_types.cpp b/source/cell/index_types.cpp index 3c306a00..cecc6b0e 100644 --- a/source/cell/index_types.cpp +++ b/source/cell/index_types.cpp @@ -109,27 +109,11 @@ column_t::column_t(const char *column_string) { } -column_t::column_t(const column_t &other) - : column_t(other.index) -{ -} - -column_t::column_t(column_t &&other) -{ - swap(*this, other); -} - std::string column_t::column_string() const { return column_string_from_index(index); } -column_t &column_t::operator=(column_t rhs) -{ - swap(*this, rhs); - return *this; -} - column_t &column_t::operator=(const std::string &rhs) { return *this = column_t(rhs); diff --git a/source/worksheet/range_reference.cpp b/source/worksheet/range_reference.cpp index c53a33ef..54033b64 100644 --- a/source/worksheet/range_reference.cpp +++ b/source/worksheet/range_reference.cpp @@ -46,12 +46,6 @@ range_reference::range_reference(const char *range_string) { } -range_reference::range_reference(const range_reference &ref) -{ - top_left_ = ref.top_left_; - bottom_right_ = ref.bottom_right_; -} - range_reference::range_reference(const std::string &range_string) : top_left_("A1"), bottom_right_("A1") {