Use constexpr AttachmentInfo and some helper
This commit is contained in:
parent
74bd0ab75d
commit
b6ed69db8a
|
@ -16,7 +16,7 @@ enum class AttachmentAction { Add, Update, Remove };
|
|||
|
||||
class AttachmentInfo {
|
||||
public:
|
||||
AttachmentInfo();
|
||||
constexpr AttachmentInfo();
|
||||
void parseDenotation(const char *denotation);
|
||||
void apply(TagParser::AbstractContainer *container, TagParser::Diagnostics &diag);
|
||||
void apply(TagParser::AbstractAttachment *attachment, TagParser::Diagnostics &diag);
|
||||
|
@ -32,7 +32,7 @@ public:
|
|||
const char *desc;
|
||||
};
|
||||
|
||||
inline AttachmentInfo::AttachmentInfo()
|
||||
constexpr AttachmentInfo::AttachmentInfo()
|
||||
: action(AttachmentAction::Add)
|
||||
, id(0)
|
||||
, hasId(false)
|
||||
|
|
|
@ -36,12 +36,12 @@ namespace Cli {
|
|||
|
||||
enum class DenotationType { Normal, Increment, File };
|
||||
|
||||
inline TagType operator|(TagType lhs, TagType rhs)
|
||||
constexpr TagType operator|(TagType lhs, TagType rhs)
|
||||
{
|
||||
return static_cast<TagType>(static_cast<unsigned int>(lhs) | static_cast<unsigned int>(rhs));
|
||||
}
|
||||
|
||||
inline TagType operator&(TagType lhs, TagType rhs)
|
||||
constexpr TagType operator&(TagType lhs, TagType rhs)
|
||||
{
|
||||
return static_cast<TagType>(static_cast<unsigned int>(lhs) & static_cast<unsigned int>(rhs));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue