TPropertyRef: Make use of symmetrical comparison operators
Makes the interface significantly more flexible.
This commit is contained in:
parent
a48d3202b6
commit
d1939eea95
|
@ -58,15 +58,32 @@ public:
|
||||||
return Get();
|
return Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(IProperty* pProperty) const
|
bool operator==(const IProperty* pProperty) const
|
||||||
{
|
{
|
||||||
return mpProperty == pProperty;
|
return mpProperty == pProperty;
|
||||||
}
|
}
|
||||||
|
bool operator!=(const IProperty* pProperty) const
|
||||||
|
{
|
||||||
|
return !operator==(pProperty);
|
||||||
|
}
|
||||||
|
|
||||||
friend bool operator==(IProperty* pLeft, const TPropertyRef& kRight)
|
friend bool operator==(const IProperty* pLeft, const TPropertyRef& kRight)
|
||||||
{
|
{
|
||||||
return pLeft == kRight.Property();
|
return pLeft == kRight.Property();
|
||||||
}
|
}
|
||||||
|
friend bool operator!=(const IProperty* pLeft, const TPropertyRef& kRight)
|
||||||
|
{
|
||||||
|
return !operator==(pLeft, kRight);
|
||||||
|
}
|
||||||
|
|
||||||
|
friend bool operator==(const TPropertyRef& left, const IProperty* right)
|
||||||
|
{
|
||||||
|
return left.Property() == right;
|
||||||
|
}
|
||||||
|
friend bool operator!=(const TPropertyRef& left, const IProperty* right)
|
||||||
|
{
|
||||||
|
return !operator==(left, right);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Convenience typedefs */
|
/** Convenience typedefs */
|
||||||
|
|
Loading…
Reference in New Issue