C++ style guide: Difference between revisions

372 bytes added ,  1 September 2021
New "class declarations" section
m (Adjust indentation level)
(New "class declarations" section)
Line 94: Line 94:
parenthesis.  You should put a space before the left open parenthesis and after
parenthesis.  You should put a space before the left open parenthesis and after
commas, for both function definitions and function calls.
commas, for both function definitions and function calls.
=== Class declarations ===
The access specifier ({{codeline|public:}}, {{codeline|protected:}}, {{codeline|private:}}) should always be stated rather than relying on the C++ language defaults for a particular object (for example, {{codeline|class = private}}).
Within a class the different access blocks should appear in the order 1) public, 2) protected, 3) private.


=== Namespace ===
=== Namespace ===
1,072

edits