Skip to content

Update coding style policy for new C++ features and disputable cases

The general idea of changes:

  • use new {}-initialization for class members and namespace-scope variables

  • use old =-intialization in function bodies

  • use auto only as a replacement for templated code, not as mere typename shortcut (with a few exceptions, like range-based-for and iterators)

  • in exceptional cases, make sure that .cpp/.h files pair has consistent styling and the benefit of restyling outweigh the loss of git-blame history. That is, if you are rewriting the file completely, you can change the style as well. If you change a few lines, just reuse existing style.

I also looked through the list of new features of C++14, but I decided not to include them into the list, since they don't seem to trigger any disputes on IRC. We can add them when/if they cause any troubles.

Edited by Halla Rempt

Merge request reports