C++ style guide: Difference between revisions

Jump to navigation Jump to search
281 bytes added ,  16 August 2016
→‎Namespace: explain reasons why we don't indent namespace
(→‎Formatting: add section about namespace)
(→‎Namespace: explain reasons why we don't indent namespace)
Line 29: Line 29:
Ask before creating a new namespace.
Ask before creating a new namespace.


* Do not indent namespace;
* Do not indent namespace. The reasons are:
:* simpler diffs
:* no need to break lines that get 2 or 4 extra columns added to the beginning
:* having the opening brace of functions and classes in column 1
:* it may look weird on a small example, but most files will be enclosed in a single namespace anyway.
* Define namespace on the .cc files;
* Define namespace on the .cc files;
* Do not use "using X" directives;
* Do not use "using X" directives;

Navigation menu