Skip to content

Commit 13ae51e

Browse files
committed
Core (LV::Palette): Add comparison operators.
1 parent a8c959a commit 13ae51e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

libvisual/libvisual/lv_palette.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#ifdef __cplusplus
3737

38+
#include <algorithm>
3839
#include <vector>
3940

4041
namespace LV {
@@ -70,6 +71,16 @@ namespace LV {
7071
return *this;
7172
}
7273

74+
constexpr friend bool operator== (Palette const& lhs, Palette const& rhs)
75+
{
76+
return lhs.colors == rhs.colors;
77+
}
78+
79+
constexpr friend bool operator!= (Palette const& lhs, Palette const& rhs)
80+
{
81+
return !(lhs == rhs);
82+
}
83+
7384
bool empty () const
7485
{
7586
return colors.empty ();

0 commit comments

Comments
 (0)