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;
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)
: 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
lhs.bg == rhs.bg and
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);
}