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 <[email protected]>

* clang-tidy: add missing deleted functions

Found with cppcoreguidelines-special-member-functions

Signed-off-by: Rosen Penev <[email protected]>

* unique_ptr conversions

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

Also added missing = default.

Signed-off-by: Rosen Penev <[email protected]>

---------

Signed-off-by: Rosen Penev <[email protected]>
This commit is contained in:
Rosen Penev
2023-08-07 15:08:40 -05:00
committed by GitHub
parent 843a8aac80
commit 185bb7042e
183 changed files with 836 additions and 835 deletions
+4 -4
View File
@@ -52,6 +52,9 @@ namespace TagLib {
*/
virtual ~Tag();
Tag(const Tag &) = delete;
Tag &operator=(const Tag &) = delete;
/*!
* Exports the tags of the file as dictionary mapping (human readable) tag
* names (Strings) to StringLists of tag values.
@@ -187,11 +190,8 @@ namespace TagLib {
Tag();
private:
Tag(const Tag &) = delete;
Tag &operator=(const Tag &) = delete;
class TagPrivate;
TagPrivate *d;
std::unique_ptr<TagPrivate> d;
};
} // namespace TagLib