constexprify Face

This commit is contained in:
Maxime Coste 2015-03-21 16:32:22 +00:00
parent 74ecf4976e
commit dbbbc3aa80

View File

@ -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);
} }