constexprify Face
This commit is contained in:
parent
74ecf4976e
commit
dbbbc3aa80
|
@ -25,19 +25,19 @@ struct Face
|
||||||
Color bg;
|
Color bg;
|
||||||
Attribute attributes;
|
Attribute attributes;
|
||||||
|
|
||||||
Face(Color fg = Colors::Default, Color bg = Colors::Default,
|
constexpr Face(Color fg = Colors::Default, Color bg = Colors::Default,
|
||||||
Attribute attributes = Attribute::Normal)
|
Attribute attributes = Attribute::Normal)
|
||||||
: fg{fg}, bg{bg}, attributes{attributes} {}
|
: fg{fg}, bg{bg}, attributes{attributes} {}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool operator==(const Face& lhs, const Face& rhs)
|
constexpr bool operator==(const Face& lhs, const Face& rhs)
|
||||||
{
|
{
|
||||||
return lhs.fg == rhs.fg and
|
return lhs.fg == rhs.fg and
|
||||||
lhs.bg == rhs.bg and
|
lhs.bg == rhs.bg and
|
||||||
lhs.attributes == rhs.attributes;
|
lhs.attributes == rhs.attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator!=(const Face& lhs, const Face& rhs)
|
constexpr bool operator!=(const Face& lhs, const Face& rhs)
|
||||||
{
|
{
|
||||||
return not (lhs == rhs);
|
return not (lhs == rhs);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user