Use unique_ptr for d-pointers (#1095)

* clang-tidy: make deleted members public

One oversight of modernize-use-equals-delete is that the C++11 way of
doing this is to make it public, which makes the warning still trigger.

Signed-off-by: Rosen Penev <rosenp@gmail.com>

* clang-tidy: add missing deleted functions

Found with cppcoreguidelines-special-member-functions

Signed-off-by: Rosen Penev <rosenp@gmail.com>

* unique_ptr conversions

unique_ptr is a safer and cleaner way to handle d pointers.

Also added missing = default.

Signed-off-by: Rosen Penev <rosenp@gmail.com>

---------

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2023-08-07 13:08:40 -07:00
committed by GitHub
parent 843a8aac80
commit 185bb7042e
183 changed files with 836 additions and 835 deletions

View File

@@ -28,6 +28,8 @@
#include "taglib_export.h"
#include <memory>
namespace TagLib {
//! A simple, abstract interface to common audio properties
@@ -64,6 +66,9 @@ namespace TagLib {
*/
virtual ~AudioProperties();
AudioProperties(const AudioProperties &) = delete;
AudioProperties &operator=(const AudioProperties &) = delete;
/*!
* Returns the length of the file in seconds. The length is rounded down to
* the nearest whole second.
@@ -118,11 +123,8 @@ namespace TagLib {
AudioProperties(ReadStyle style);
private:
AudioProperties(const AudioProperties &) = delete;
AudioProperties &operator=(const AudioProperties &) = delete;
class AudioPropertiesPrivate;
AudioPropertiesPrivate *d;
std::unique_ptr<AudioPropertiesPrivate> d;
};
} // namespace TagLib