buffer: move Buffer::Flags operator as friends defined inside Buffer

This commit is contained in:
Maxime Coste 2013-08-01 00:28:01 +02:00
parent c6f08f6c34
commit a2577b4180

View File

@ -203,34 +203,34 @@ private:
OptionManager m_options;
HookManager m_hooks;
};
constexpr Buffer::Flags operator|(Buffer::Flags lhs, Buffer::Flags rhs)
{
return (Buffer::Flags)((int) lhs | (int) rhs);
}
friend constexpr Flags operator|(Flags lhs, Flags rhs)
{
return (Flags)((int) lhs | (int) rhs);
}
inline Buffer::Flags& operator|=(Buffer::Flags& lhs, Buffer::Flags rhs)
{
friend Flags& operator|=(Flags& lhs, Flags rhs)
{
(int&) lhs |= (int) rhs;
return lhs;
}
}
constexpr bool operator&(Buffer::Flags lhs, Buffer::Flags rhs)
{
friend constexpr bool operator&(Flags lhs, Flags rhs)
{
return ((int) lhs & (int) rhs) != 0;
}
}
inline Buffer::Flags& operator&=(Buffer::Flags& lhs, Buffer::Flags rhs)
{
friend Flags& operator&=(Flags& lhs, Flags rhs)
{
(int&) lhs &= (int) rhs;
return lhs;
}
}
constexpr Buffer::Flags operator~(Buffer::Flags lhs)
{
return (Buffer::Flags)(~(int)lhs);
}
friend constexpr Flags operator~(Flags lhs)
{
return (Flags)(~(int)lhs);
}
};
struct BufferListenerRegisterFuncs
{