No need to define copy & move ctors
This commit is contained in:
parent
2bacff0f5c
commit
3a749e6861
@ -166,37 +166,15 @@ namespace Exiv2 {
|
||||
//! @name Creators
|
||||
//@{
|
||||
//! Default constructor
|
||||
DataBuf();
|
||||
DataBuf() = default;
|
||||
//! Constructor with an initial buffer size
|
||||
explicit DataBuf(long size);
|
||||
//! Constructor, copies an existing buffer
|
||||
DataBuf(const byte* pData, long size);
|
||||
/*!
|
||||
@brief Copy constructor. Copies an existing DataBuf.
|
||||
*/
|
||||
DataBuf(const DataBuf& rhs);
|
||||
/*!
|
||||
@brief Move constructor. Transfers the buffer to the newly created
|
||||
object similar to std::unique_ptr, i.e., the original object is
|
||||
modified.
|
||||
*/
|
||||
DataBuf(DataBuf&& rhs);
|
||||
//! Destructor, deletes the allocated buffer
|
||||
~DataBuf();
|
||||
//@}
|
||||
|
||||
//! @name Manipulators
|
||||
//@{
|
||||
/*!
|
||||
@brief Assignment operator. Transfers the buffer and releases the
|
||||
buffer at the original object similar to std::unique_ptr, i.e.,
|
||||
the original object is modified.
|
||||
*/
|
||||
DataBuf& operator=(DataBuf&& rhs);
|
||||
|
||||
// No copy assignment.
|
||||
DataBuf& operator=(const DataBuf&) = delete;
|
||||
|
||||
/*!
|
||||
@brief Allocate a data buffer of at least the given size. Note that if
|
||||
the requested \em size is less than the current buffer size, no
|
||||
|
||||
@ -118,17 +118,6 @@ namespace Exiv2 {
|
||||
return tit->size_;
|
||||
}
|
||||
|
||||
DataBuf::DataBuf(DataBuf&& rhs)
|
||||
: pData_(std::move(rhs.pData_))
|
||||
{
|
||||
}
|
||||
|
||||
DataBuf::~DataBuf()
|
||||
{ }
|
||||
|
||||
DataBuf::DataBuf() : pData_()
|
||||
{}
|
||||
|
||||
DataBuf::DataBuf(long size) : pData_(size)
|
||||
{}
|
||||
|
||||
@ -137,18 +126,6 @@ namespace Exiv2 {
|
||||
std::copy_n(pData, size, pData_.begin());
|
||||
}
|
||||
|
||||
DataBuf::DataBuf(const DataBuf& rhs)
|
||||
: DataBuf(rhs.pData_.data(), rhs.pData_.size())
|
||||
{}
|
||||
|
||||
DataBuf& DataBuf::operator=(DataBuf&& rhs)
|
||||
{
|
||||
if (this == &rhs)
|
||||
return *this;
|
||||
pData_ = std::move(rhs.pData_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void DataBuf::alloc(long size)
|
||||
{
|
||||
pData_.resize(size);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user