pass small structs and POD types to Window::operator<<() by value

This commit is contained in:
Andrzej Rybczak
2009-04-03 22:33:00 +02:00
parent 2d8b5f7abc
commit a1376e8a4e
2 changed files with 18 additions and 18 deletions

View File

@@ -659,7 +659,7 @@ void Window::Scroll(Where where)
}
Window &Window::operator<<(const Colors &colors)
Window &Window::operator<<(Colors colors)
{
if (colors.fg == clEnd || colors.bg == clEnd)
return *this;
@@ -668,7 +668,7 @@ Window &Window::operator<<(const Colors &colors)
return *this;
}
Window &Window::operator<<(const Color &color)
Window &Window::operator<<(Color color)
{
switch (color)
{
@@ -692,7 +692,7 @@ Window &Window::operator<<(const Color &color)
return *this;
}
Window &Window::operator<<(const Format &format)
Window &Window::operator<<(Format format)
{
switch (format)
{
@@ -729,7 +729,7 @@ Window &Window::operator<<(int (*f)(WINDOW *))
return *this;
}
Window &Window::operator<<(const XY &coords)
Window &Window::operator<<(XY coords)
{
GotoXY(coords.x, coords.y);
return *this;
@@ -741,7 +741,7 @@ Window &Window::operator<<(const char *s)
return *this;
}
Window &Window::operator<<(const char &c)
Window &Window::operator<<(char c)
{
wprintw(itsWindow, "%c", c);
return *this;
@@ -753,19 +753,19 @@ Window &Window::operator<<(const wchar_t *ws)
return *this;
}
Window &Window::operator<<(const wchar_t &wc)
Window &Window::operator<<(wchar_t wc)
{
wprintw(itsWindow, "%lc", wc);
return *this;
}
Window &Window::operator<<(const int &i)
Window &Window::operator<<(int i)
{
wprintw(itsWindow, "%d", i);
return *this;
}
Window &Window::operator<<(const double &d)
Window &Window::operator<<(double d)
{
wprintw(itsWindow, "%f", d);
return *this;
@@ -785,7 +785,7 @@ Window &Window::operator<<(const wstring &ws)
return *this;
}
Window &Window::operator<<(const size_t &s)
Window &Window::operator<<(size_t s)
{
wprintw(itsWindow, "%u", s);
return *this;

View File

@@ -128,17 +128,17 @@ namespace NCurses
virtual void Scroll(Where);
Window &operator<<(int (*)(WINDOW *));
Window &operator<<(const Colors &);
Window &operator<<(const Color &);
Window &operator<<(const Format &);
Window &operator<<(const XY &);
Window &operator<<(Colors);
Window &operator<<(Color);
Window &operator<<(Format);
Window &operator<<(XY);
Window &operator<<(const char *);
Window &operator<<(const char &);
Window &operator<<(char);
Window &operator<<(const wchar_t *);
Window &operator<<(const wchar_t &);
Window &operator<<(const int &);
Window &operator<<(const double &);
Window &operator<<(const size_t &);
Window &operator<<(wchar_t);
Window &operator<<(int);
Window &operator<<(double);
Window &operator<<(size_t);
Window &operator<<(const std::string &);
Window &operator<<(const std::wstring &);