mirror of
https://github.com/taglib/taglib.git
synced 2026-06-07 14:59:24 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user