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,35 +203,35 @@ private:
OptionManager m_options; OptionManager m_options;
HookManager m_hooks; HookManager m_hooks;
friend constexpr Flags operator|(Flags lhs, Flags rhs)
{
return (Flags)((int) lhs | (int) rhs);
}
friend Flags& operator|=(Flags& lhs, Flags rhs)
{
(int&) lhs |= (int) rhs;
return lhs;
}
friend constexpr bool operator&(Flags lhs, Flags rhs)
{
return ((int) lhs & (int) rhs) != 0;
}
friend Flags& operator&=(Flags& lhs, Flags rhs)
{
(int&) lhs &= (int) rhs;
return lhs;
}
friend constexpr Flags operator~(Flags lhs)
{
return (Flags)(~(int)lhs);
}
}; };
constexpr Buffer::Flags operator|(Buffer::Flags lhs, Buffer::Flags rhs)
{
return (Buffer::Flags)((int) lhs | (int) rhs);
}
inline Buffer::Flags& operator|=(Buffer::Flags& lhs, Buffer::Flags rhs)
{
(int&) lhs |= (int) rhs;
return lhs;
}
constexpr bool operator&(Buffer::Flags lhs, Buffer::Flags rhs)
{
return ((int) lhs & (int) rhs) != 0;
}
inline Buffer::Flags& operator&=(Buffer::Flags& lhs, Buffer::Flags rhs)
{
(int&) lhs &= (int) rhs;
return lhs;
}
constexpr Buffer::Flags operator~(Buffer::Flags lhs)
{
return (Buffer::Flags)(~(int)lhs);
}
struct BufferListenerRegisterFuncs struct BufferListenerRegisterFuncs
{ {
static void insert(const Buffer& buffer, BufferChangeListener& listener) static void insert(const Buffer& buffer, BufferChangeListener& listener)