2.2.1 Braces

if, while, etc *must* always have braces.

eg. Good

if (a == b)
    {
       dosomething();
    }

Braces should be on separate line like above.

e.g BAD

if (a == b) {
       dosomething();
    }

Inline methods inside class(struct) is ok to write like below, (i.e opening brace is on same line as function declaration)

struct A 
    {
       A() {
       }
    }

User Comments
Sign Up Login You must be logged in to post a comment.