diff --git a/include/fastdds/dds/publisher/qos/DataWriterQos.hpp b/include/fastdds/dds/publisher/qos/DataWriterQos.hpp index 634afb025c5..0c0cd2a275f 100644 --- a/include/fastdds/dds/publisher/qos/DataWriterQos.hpp +++ b/include/fastdds/dds/publisher/qos/DataWriterQos.hpp @@ -60,8 +60,7 @@ class RTPSReliableWriterQos inline void clear() { - RTPSReliableWriterQos reset = RTPSReliableWriterQos(); - std::swap(*this, reset); + *this = RTPSReliableWriterQos(); } //!Writer Timing Attributes diff --git a/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp b/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp index 64b85b227e0..17339fd2c2d 100644 --- a/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp +++ b/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp @@ -60,8 +60,7 @@ class RTPSReliableReaderQos inline void clear() { - RTPSReliableReaderQos reset = RTPSReliableReaderQos(); - std::swap(*this, reset); + *this = RTPSReliableReaderQos(); } /*!