Open main menu

Difference between revisions of "Code Formatting Conventions"

→‎Whitespaces: added rules for template definiton and operator overloading
(→‎Whitespaces: Add delete[] convention)
(→‎Whitespaces: added rules for template definiton and operator overloading)
Line 78: Line 78:
</pre>
</pre>


'''delete operator has no whitespace before []'''
'''array delete operator has no whitespace before []'''
<pre>
<pre>
delete[] foo;
delete[] foo;
</pre>
'''Template definitions'''
no whitespace between template and <
<pre>
template<typename foo>
void myFunc(foo arg) {
    // ...
}
</pre>
'''Operator overloading'''
no whitespace between operator name and opening parentheses on definition (like with normal function/method definitions)
<pre>
bool operator==(const MyType &l, const MyType &r) {
    // ...
}
</pre>
</pre>


561

edits