Use general flags utility for Face Attribute

This commit is contained in:
Maxime Coste 2014-11-12 20:31:56 +00:00
parent 3f733569ed
commit 58c1721564

View File

@ -2,6 +2,7 @@
#define face_hh_INCLUDED #define face_hh_INCLUDED
#include "color.hh" #include "color.hh"
#include "flags.hh"
namespace Kakoune namespace Kakoune
{ {
@ -16,25 +17,7 @@ enum class Attribute : int
Dim = 1 << 5 Dim = 1 << 5
}; };
inline constexpr Attribute operator|(Attribute lhs, Attribute rhs) template<> struct WithBitOps<Attribute> : std::true_type {};
{
return (Attribute)((int) lhs | (int) rhs);
}
inline Attribute& operator|=(Attribute& lhs, Attribute rhs)
{
return (Attribute&)((int&) lhs |= (int) rhs);
}
inline constexpr bool operator&(Attribute lhs, Attribute rhs)
{
return ((int) lhs & (int) rhs) != 0;
}
inline Attribute& operator&=(Attribute& lhs, Attribute rhs)
{
return (Attribute&)((int&) lhs &= (int) rhs);
}
struct Face struct Face
{ {