return value, not const reference, if return type is POD or ptr
returning reference to POD types can be in fact slower than returning value.
This commit is contained in:
@@ -540,12 +540,12 @@ void Window::GotoXY(int x, int y)
|
||||
itsY = y;
|
||||
}
|
||||
|
||||
const int &Window::X() const
|
||||
int Window::X() const
|
||||
{
|
||||
return itsX;
|
||||
}
|
||||
|
||||
const int &Window::Y() const
|
||||
int Window::Y() const
|
||||
{
|
||||
return itsY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user