Skip to content

Commit

Permalink
remove declarations of copy/assignment operators that only do default…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
Crzyrndm committed Mar 1, 2020
1 parent 39f498f commit 932fc45
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 39 deletions.
15 changes: 0 additions & 15 deletions include/xlnt/cell/index_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,11 @@ class XLNT_API column_t
/// </summary>
column_t(const char *column_string);

/// <summary>
/// Copy constructor. Constructs a column by copying it from other.
/// </summary>
column_t(const column_t &other);

/// <summary>
/// Move constructor. Constructs a column by moving it from other.
/// </summary>
column_t(column_t &&other);

/// <summary>
/// Returns a string representation of this column index.
/// </summary>
std::string column_string() const;

/// <summary>
/// Sets this column to be the same as rhs's and return reference to self.
/// </summary>
column_t &operator=(column_t rhs);

/// <summary>
/// Sets this column to be equal to rhs and return reference to self.
/// </summary>
Expand Down
2 changes: 0 additions & 2 deletions include/xlnt/worksheet/range_reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ class XLNT_API range_reference
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);

/// <summary>
/// Returns true if the range has a width and height of 1 cell.
/// </summary>
Expand Down
16 changes: 0 additions & 16 deletions source/cell/index_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 0 additions & 6 deletions source/worksheet/range_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
{
Expand Down

0 comments on commit 932fc45

Please # to comment.