From bbfcfe4242e50c8952ae6cf05436c81e9a5e8170 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 20 Mar 2015 19:03:41 +0000 Subject: [PATCH] constexprify Color (in)equality operator --- src/color.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/color.hh b/src/color.hh index 1bf7ee33..ae146812 100644 --- a/src/color.hh +++ b/src/color.hh @@ -36,13 +36,13 @@ struct Color : color{Colors::RGB}, r{r}, g{g}, b{b} {} }; -inline bool operator==(Color lhs, Color rhs) +constexpr bool operator==(Color lhs, Color rhs) { return lhs.color == rhs.color and lhs.r == rhs.r and lhs.g == rhs.g and lhs.b == rhs.b; } -inline bool operator!=(Color lhs, Color rhs) +constexpr bool operator!=(Color lhs, Color rhs) { return not (lhs == rhs); }