add uint/long/ulong overloads of operator* and operator/ to avoid problems with ambiguos overloads in wxSize

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi 2009-02-01 14:16:20 +00:00
parent ee08bdb5b6
commit 06d7b2176b

View File

@ -240,6 +240,12 @@ public:
wxSize& operator-=(const wxSize& sz) { x -= sz.x; y -= sz.y; return *this; }
wxSize& operator/=(int i) { x /= i; y /= i; return *this; }
wxSize& operator*=(int i) { x *= i; y *= i; return *this; }
wxSize& operator/=(unsigned int i) { x /= i; y /= i; return *this; }
wxSize& operator*=(unsigned int i) { x *= i; y *= i; return *this; }
wxSize& operator/=(long i) { x /= i; y /= i; return *this; }
wxSize& operator*=(long i) { x *= i; y *= i; return *this; }
wxSize& operator/=(unsigned long i) { x /= i; y /= i; return *this; }
wxSize& operator*=(unsigned long i) { x *= i; y *= i; return *this; }
wxSize& operator/=(double i) { x = int(x/i); y = int(y/i); return *this; }
wxSize& operator*=(double i) { x = int(x*i); y = int(y*i); return *this; }
@ -320,6 +326,51 @@ inline wxSize operator*(int i, const wxSize& s)
return wxSize(s.x * i, s.y * i);
}
inline wxSize operator/(const wxSize& s, unsigned int i)
{
return wxSize(s.x / i, s.y / i);
}
inline wxSize operator*(const wxSize& s, unsigned int i)
{
return wxSize(s.x * i, s.y * i);
}
inline wxSize operator*(unsigned int i, const wxSize& s)
{
return wxSize(s.x * i, s.y * i);
}
inline wxSize operator/(const wxSize& s, long i)
{
return wxSize(s.x / i, s.y / i);
}
inline wxSize operator*(const wxSize& s, long i)
{
return wxSize(s.x * i, s.y * i);
}
inline wxSize operator*(long i, const wxSize& s)
{
return wxSize(s.x * i, s.y * i);
}
inline wxSize operator/(const wxSize& s, unsigned long i)
{
return wxSize(s.x / i, s.y / i);
}
inline wxSize operator*(const wxSize& s, unsigned long i)
{
return wxSize(s.x * i, s.y * i);
}
inline wxSize operator*(unsigned long i, const wxSize& s)
{
return wxSize(s.x * i, s.y * i);
}
inline wxSize operator*(const wxSize& s, double i)
{
return wxSize(int(s.x * i), int(s.y * i));