Skip to content

Commit

Permalink
Refs #20815: Delete copy semantic from DynamicLoanableSequence
Browse files Browse the repository at this point in the history
Signed-off-by: eduponz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz committed Jun 5, 2024
1 parent 344c935 commit 0164529
Showing 1 changed file with 4 additions and 33 deletions.
37 changes: 4 additions & 33 deletions include/fastrtps/types/DynamicLoanableSequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,42 +89,13 @@ class LoanableSequence<fastrtps::types::DynamicData, _NonConstEnabler>
release();
}

/**
* @brief Copy constructor for LoanableSequence.
*
* @param[in] other The other LoanableSequence to copy from.
*/
/// Deleted copy constructor for LoanableSequence.
LoanableSequence(
const LoanableSequence& other)
{
*this = other;
}
const LoanableSequence& other) = delete;

/**
* @brief Copy assignment operator for LoanableSequence.
*
* @param[in] other The other LoanableSequence to assign from.
*
* @return A reference to this LoanableSequence.
*/
/// Deleted copy assignment operator for LoanableSequence.
LoanableSequence& operator =(
const LoanableSequence& other)
{
if (!has_ownership_)
{
release();
}

LoanableCollection::length(other.length());
const element_type* other_buf = other.buffer();
for (size_type n = 0; n < length_; ++n)
{
*static_cast<fastrtps::types::DynamicData*>(elements_[n]) =
*static_cast<const fastrtps::types::DynamicData*>(other_buf[n]);
}

return *this;
}
const LoanableSequence& other) = delete;

/**
* @brief Move constructor for LoanableSequence.
Expand Down

0 comments on commit 0164529

Please sign in to comment.