Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

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" over std::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" over std::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" over std::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?

Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

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" over std::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?

lang-cpp

AltStyle によって変換されたページ (->オリジナル) /