From 4555495a0b0a099e1488b23175c6077db224c73c Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Mon, 18 Dec 2023 07:41:30 +0100 Subject: [PATCH] make the EbmlCallbacks constructor a constexpr --- ebml/EbmlElement.h | 9 ++++++++- src/EbmlElement.cpp | 9 --------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index 8feabe63..19373051 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -256,7 +256,14 @@ extern const EbmlSemanticContext Context_EbmlGlobal; */ class EBML_DLL_API EbmlCallbacks { public: - EbmlCallbacks(EbmlElement & (*Creator)(), const EbmlId & aGlobalId, const char * aDebugName, const EbmlSemanticContext & aContext); + constexpr EbmlCallbacks(EbmlElement & (*Creator)(), const EbmlId & aGlobalId, const char * aDebugName, const EbmlSemanticContext & aContext) + :Create(Creator) + ,GlobalId(aGlobalId) + ,DebugName(aDebugName) + ,Context(aContext) + { + assert(Creator!=nullptr); + } inline const EbmlId & ClassId() const { return GlobalId; } inline const EbmlSemanticContext & GetContext() const { return Context; } diff --git a/src/EbmlElement.cpp b/src/EbmlElement.cpp index ec6ad688..324ef015 100644 --- a/src/EbmlElement.cpp +++ b/src/EbmlElement.cpp @@ -211,15 +211,6 @@ std::int64_t ReadCodedSizeSignedValue(const binary * InBuffer, std::uint32_t & B } -EbmlCallbacks::EbmlCallbacks(EbmlElement & (*Creator)(), const EbmlId & aGlobalId, const char * aDebugName, const EbmlSemanticContext & aContext) - :Create(Creator) - ,GlobalId(aGlobalId) - ,DebugName(aDebugName) - ,Context(aContext) -{ - assert(Create!=nullptr); -} - const EbmlSemantic & EbmlSemanticContext::GetSemantic(std::size_t i) const { assert(i