Use general flags utility for Face Attribute
This commit is contained in:
parent
3f733569ed
commit
58c1721564
21
src/face.hh
21
src/face.hh
|
@ -2,6 +2,7 @@
|
|||
#define face_hh_INCLUDED
|
||||
|
||||
#include "color.hh"
|
||||
#include "flags.hh"
|
||||
|
||||
namespace Kakoune
|
||||
{
|
||||
|
@ -16,25 +17,7 @@ enum class Attribute : int
|
|||
Dim = 1 << 5
|
||||
};
|
||||
|
||||
inline constexpr Attribute operator|(Attribute lhs, Attribute rhs)
|
||||
{
|
||||
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);
|
||||
}
|
||||
template<> struct WithBitOps<Attribute> : std::true_type {};
|
||||
|
||||
struct Face
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user