Skip to content

Commit

Permalink
make the EbmlCallbacks constructor a constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Dec 18, 2023
1 parent c4b33d1 commit 5159be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 8 additions & 1 deletion ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,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; }
Expand Down
9 changes: 0 additions & 9 deletions src/EbmlElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Size);
Expand Down

0 comments on commit 5159be2

Please sign in to comment.