[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] WXWIN_COMPATIBILITY_3_x suggestion
From: |
Greg Chicares |
Subject: |
[lmi] WXWIN_COMPATIBILITY_3_x suggestion |
Date: |
Sun, 13 May 2018 00:46:24 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
Next time a new API version is declared, guards could be added around
these backward-compatibility members in include/wx/gdicmn.h :
class WXDLLIMPEXP_CORE wxSize
{
public:
// members are public for compatibility, don't use them directly.
int x, y;
...
// compatibility
int GetX() const { return x; }
int GetY() const { return y; }
I guess 'x' and 'y' are so convenient that it's easy to resist the
advice to use GetWidth() and GetHeight() instead. But if they're
never deprecated, people will always use 'x' and 'y'.
It seems pointless to suggest shorter names like GetX() and GetY()
because those already exist, for compatibility only. But even
x() const and y() const would be safer than accessing data members
directly in a const context.
- [lmi] WXWIN_COMPATIBILITY_3_x suggestion,
Greg Chicares <=