Skip to content

Commit

Permalink
bring back const on constexpr definitions
Browse files Browse the repository at this point in the history
constexpr doesn't imply const
  • Loading branch information
robUx4 committed Dec 31, 2023
1 parent e432119 commit 0b30276
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ class EbmlElement;
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, nullptr, global, nullptr); \

#define DEFINE_xxx_MASTER(x,id,idl,parent,infinite,name,global) \
constexpr EbmlId Id_##x (id, idl); \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x); \
x::x() :EbmlMaster(x::ClassInfos, Context_##x) {}

// define a master class with a custom constructor
#define DEFINE_xxx_MASTER_CONS(x,id,idl,parent,infinite,name,global) \
constexpr EbmlId Id_##x (id, idl); \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x);

// define a master class with no parent class
#define DEFINE_xxx_MASTER_ORPHAN(x,id,idl,infinite,name,global) \
constexpr EbmlId Id_##x (id, idl); \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, nullptr, global, &EBML_INFO(x)); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, infinite, name, Context_##x); \

#define DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,global) \
constexpr EbmlId Id_##x (id, idl); \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, &Context_##parent, global, &EBML_INFO(x));

#define DEFINE_xxx_CLASS(x,id,idl,parent,name,global) \
Expand Down Expand Up @@ -145,7 +145,7 @@ class EbmlElement;
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, name, EmptyContext_##x); \

#define DEFINE_xxx_CLASS_ORPHAN(x,id,idl,name,global) \
constexpr EbmlId Id_##x (id, idl); \
constexpr const EbmlId Id_##x (id, idl); \
const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, nullptr, nullptr, global, nullptr); \
const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, name, Context_##x); \

Expand Down

0 comments on commit 0b30276

Please sign in to comment.