Skip to content

Commit

Permalink
add missing destructors
Browse files Browse the repository at this point in the history
Found with MSVC warnings C4626,C5027

Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb committed Feb 7, 2024
1 parent 80e6c2f commit a8881ea
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ class EBML_DLL_API EbmlDocVersion {
, maxver(max)
{}

~EbmlDocVersion() = default;
EbmlDocVersion(const EbmlDocVersion&) = delete;
EbmlDocVersion& operator=(const EbmlDocVersion&) = delete;

// the element with this EbmlDocVersion should never be used if this methods return true
bool IsAlwaysDeprecated() const {
return minver == ANY_VERSION;
Expand Down Expand Up @@ -331,6 +335,10 @@ class EBML_DLL_API EbmlCallbacks {
assert(Creator!=nullptr);
}

~EbmlCallbacks() = default;
EbmlCallbacks(const EbmlCallbacks&) = default;
EbmlCallbacks& operator=(const EbmlCallbacks&) = delete;

inline const EbmlId & ClassId() const { return GlobalId; }
inline constexpr const EbmlSemanticContext & GetContext() const { return Context; }
inline const char * GetName() const { return DebugName; }
Expand Down Expand Up @@ -359,6 +367,10 @@ class EBML_DLL_API EbmlCallbacksDefault : public EbmlCallbacks {
:EbmlCallbacks(Creator, aGlobalId, false, hasDefault, aDebugName, aContext, aVersion)
{
}

~EbmlCallbacksDefault() = default;
EbmlCallbacksDefault(const EbmlCallbacksDefault&) = default;
EbmlCallbacksDefault& operator=(const EbmlCallbacksDefault&) = delete;
};

template<typename T>
Expand Down Expand Up @@ -392,6 +404,10 @@ class EBML_DLL_API EbmlSemantic {
inline explicit operator const EbmlCallbacks &() const { return Callbacks; }
inline EbmlCallbacks const &GetCallbacks() const { return Callbacks; }

~EbmlSemantic() = default;
EbmlSemantic(const EbmlSemantic&) = default;
EbmlSemantic& operator=(const EbmlSemantic&) = delete;

private:
const bool Mandatory; ///< whether the element is mandatory in the context or not
const bool Unique;
Expand All @@ -414,6 +430,10 @@ class EBML_DLL_API EbmlSemanticContext {
: GetGlobalContext(aGetGlobalContext), MyTable(aMyTable), Size(aSize),
UpTable(aUpTable), MasterElt(aMasterElt) {}

~EbmlSemanticContext() = default;
EbmlSemanticContext(const EbmlSemanticContext&) = delete;
EbmlSemanticContext& operator=(const EbmlSemanticContext&) = delete;

bool operator!=(const EbmlSemanticContext & aElt) const {
return ((Size != aElt.Size) || (MyTable != aElt.MyTable) ||
(UpTable != aElt.UpTable) || (GetGlobalContext != aElt.GetGlobalContext) ||
Expand Down Expand Up @@ -617,6 +637,10 @@ class EBML_DLL_API EbmlElementDefault : public EbmlElement {
:EbmlElement(classInfo, aDefaultSize, false)
{}

~EbmlElementDefault() override = default;
EbmlElementDefault(const EbmlElementDefault&) = default;
EbmlElementDefault& operator=(const EbmlElementDefault&) = delete;

bool IsDefaultValue() const final {
if (!ElementSpec().HasDefault())
return false;
Expand All @@ -637,6 +661,9 @@ class EBML_DLL_API EbmlElementDefaultSameStorage : public EbmlElementDefault<T>
using EbmlElementDefault<T>::EbmlElementDefault;
using EbmlElementDefault<T>::operator const EbmlId &;

EbmlElementDefaultSameStorage(const EbmlElementDefaultSameStorage&) = default;
EbmlElementDefaultSameStorage& operator=(const EbmlElementDefaultSameStorage&) = delete;

EbmlElementDefaultSameStorage<T> & SetValue(const T & NewValue) override
{
Value = NewValue;
Expand Down Expand Up @@ -675,6 +702,9 @@ class EBML_DLL_API EbmlElementDefaultStorage : public EbmlElementDefault<T> {
using EbmlElementDefault<T>::EbmlElementDefault;
using EbmlElementDefault<T>::operator const EbmlId &;

EbmlElementDefaultStorage(const EbmlElementDefaultStorage&) = default;
EbmlElementDefaultStorage& operator=(const EbmlElementDefaultStorage&) = delete;

EbmlElementDefaultStorage<T,S> & SetValue(const T & NewValue) override
{
Value = static_cast<S>(NewValue);
Expand Down

0 comments on commit a8881ea

Please sign in to comment.