From f288c5fec572a4dac85e10eaba397da146f219c1 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sat, 24 Feb 2024 11:06:38 +0100 Subject: [PATCH] make GetSemantic() constexpr --- ebml/EbmlElement.h | 9 ++++++++- src/EbmlMaster.cpp | 12 ------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index 1952f9d7..ff5bc7cb 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace libebml { @@ -526,7 +527,13 @@ class EBML_DLL_API EbmlSemanticContextMaster : public EbmlSemanticContext { return false; } - const EbmlSemantic & GetSemantic(std::size_t i) const; + inline constexpr const EbmlSemantic & GetSemantic(std::size_t i) const + { + if (i= " << GetSize() << ")"; - throw std::logic_error(ss.str()); -} - - /*! \todo handle exception on errors \todo write all the Mandatory elements in the Context, otherwise assert