implement * and / operators for wxPoint, not only wxSize.

Add to their documentation a note about the fact that the real operators are not class members but rather global functions.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2010-05-30 23:28:14 +00:00
parent f68e16c5fc
commit ed0dd9c1f0
2 changed files with 90 additions and 0 deletions

View File

@@ -500,6 +500,13 @@ public:
/**
@name Miscellaneous operators
Note that these operators are documented as class members
(to make them easier to find) but, as their prototype shows,
they are implemented as global operators; note that this is
transparent to the user but it helps to understand why the
following functions are documented to take the wxPoint they
operate on as an explicit argument.
*/
//@{
wxPoint& operator=(const wxPoint& pt);
@@ -520,6 +527,12 @@ public:
wxPoint& operator +=(const wxSize& sz);
wxPoint& operator -=(const wxSize& sz);
wxSize operator /(const wxPoint& sz, int factor);
wxSize operator *(const wxPoint& sz, int factor);
wxSize operator *(int factor, const wxSize& sz);
wxSize& operator /=(int factor);
wxSize& operator *=(int factor);
//@}
/**
@@ -806,6 +819,13 @@ public:
/**
@name Miscellaneous operators
Note that these operators are documented as class members
(to make them easier to find) but, as their prototype shows,
they are implemented as global operators; note that this is
transparent to the user but it helps to understand why the
following functions are documented to take the wxSize they
operate on as an explicit argument.
*/
//@{
wxSize& operator=(const wxSize& sz);