Skip to content

Commit

Permalink
Removing SonarCloud warning on destructor (minor)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel AINS committed Apr 23, 2020
1 parent 7b8275e commit c34c534
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/spi/ByteBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 28,13 @@ class LIBEXPORT ByteBuffer : public std::vector<uint8_t> {
public:
ByteBuffer() : _Base() { }
ByteBuffer(const ByteBuffer& other) : _Base(other) { } //NOSONAR
~ByteBuffer() = default; /* This is to please SonarCloud because std::vector class's destructor is not virtual anyway */
/**
* @brief Destructor
*
* @warning This destructor definition is here to please SonarCloud because std::vector class's destructor is not virtual anyway
*/
~ByteBuffer() = default;

#if __cplusplus >= 201103L
ByteBuffer(ByteBuffer&& other) noexcept : _Base(std::move(other)) { }
ByteBuffer(std::vector<uint8_t>&& other) noexcept : _Base(std::move(other)) { }
Expand Down Expand Up @@ -61,6 67,7 @@ class LIBEXPORT ByteBuffer : public std::vector<uint8_t> {
this->push_back(*it);
}
}

ByteBuffer& operator=(const ByteBuffer& other) {
return static_cast<ByteBuffer&>(_Base::operator=(static_cast<_Base>(other)));
}
Expand Down

0 comments on commit c34c534

Please sign in to comment.