A few things about update()
:
It's less readable and maintainable to cram the functionality into one line. Just declare it within the class and define it outside. If the compiler decides that it should be inlined, it will do that for you.
Prefer
"\n"
overstd::endl
when just outputting a newline. The latter also flushes the buffer, which is slower and unneeded here. See this this for more information.update
is not a very accurate name. What exactly does it update?
A few things about update()
:
It's less readable and maintainable to cram the functionality into one line. Just declare it within the class and define it outside. If the compiler decides that it should be inlined, it will do that for you.
Prefer
"\n"
overstd::endl
when just outputting a newline. The latter also flushes the buffer, which is slower and unneeded here. See this for more information.update
is not a very accurate name. What exactly does it update?
A few things about update()
:
It's less readable and maintainable to cram the functionality into one line. Just declare it within the class and define it outside. If the compiler decides that it should be inlined, it will do that for you.
Prefer
"\n"
overstd::endl
when just outputting a newline. The latter also flushes the buffer, which is slower and unneeded here. See this for more information.update
is not a very accurate name. What exactly does it update?
A few things about update()
:
It's less readable and maintainable to cram the functionality into one line. Just declare it within the class and define it outside. If the compiler decides that it should be inlined, it will do that for you.
Prefer
"\n"
overstd::endl
when just outputting a newline. The latter also flushes the buffer, which is slower and unneeded here. See this for more information.update
is not a very accurate name. What exactly does it update?