diff --git a/src/storage/types.hpp b/src/storage/types.hpp index 523fe6068..912e0842f 100644 --- a/src/storage/types.hpp +++ b/src/storage/types.hpp @@ -16,6 +16,7 @@ class Common : public TotalOrdering<TSpecificType> { Common() {} explicit Common(const StorageT storage) : storage_(storage) {} + virtual ~Common() {} friend bool operator==(const TSpecificType &a, const TSpecificType &b) { return a.storage_ == b.storage_; diff --git a/src/utils/total_ordering.hpp b/src/utils/total_ordering.hpp index 5295ad32f..b31136291 100644 --- a/src/utils/total_ordering.hpp +++ b/src/utils/total_ordering.hpp @@ -11,6 +11,8 @@ */ template <typename TLhs, typename TRhs = TLhs, typename TReturn = bool> struct TotalOrdering { + virtual ~TotalOrdering() {} + friend constexpr TReturn operator!=(const TLhs& a, const TRhs& b) { return !(a == b); } @@ -30,6 +32,8 @@ struct TotalOrdering { template <class Derived, class T> struct TotalOrderingWith { + virtual ~TotalOrderingWith() {} + friend constexpr bool operator!=(const Derived& a, const T& b) { return !(a == b); }