C++ - Braces Layout
Braces Layout
Namespace declaration
Property names:
[resharper_]cpp_namespace_declaration_braces
, [resharper_]cpp_brace_style
, [resharper_]namespace_declaration_braces
, [resharper_]brace_style
Possible values:
-
next_line_shifted
: At next line indented (Whitesmiths style) -
next_line_shifted_2
: At next line indented 2 (GNU style) -
next_line
: At next line (BSD style) -
end_of_line
: At end of line (K&R style) -
end_of_line_no_space
: At end of line (no space)
Examples:
Type declaration
Property names:
[resharper_]cpp_type_declaration_braces
, [resharper_]cpp_brace_style
, [resharper_]type_declaration_braces
, [resharper_]brace_style
Possible values:
-
next_line_shifted
: At next line indented (Whitesmiths style) -
next_line_shifted_2
: At next line indented 2 (GNU style) -
next_line
: At next line (BSD style) -
end_of_line
: At end of line (K&R style) -
end_of_line_no_space
: At end of line (no space)
Examples:
Place namespace definitions on the same line
Property names:
[resharper_]cpp_place_namespace_definitions_on_same_line
, [resharper_]place_namespace_definitions_on_same_line
Possible values:
true | false
Examples:
true |
namespace·A·{·namespace·B
{
··void·a();
}} |
false |
namespace·A
{
··namespace·B
··{
····void·a();
··}
} |
Function declaration
Property names:
[resharper_]cpp_invocable_declaration_braces
, [resharper_]cpp_brace_style
, [resharper_]invocable_declaration_braces
, [resharper_]brace_style
Possible values:
-
next_line_shifted
: At next line indented (Whitesmiths style) -
next_line_shifted_2
: At next line indented 2 (GNU style) -
next_line
: At next line (BSD style) -
end_of_line
: At end of line (K&R style) -
end_of_line_no_space
: At end of line (no space)
Examples:
next_line_shifted |
void·a()
··{
··b();
··} |
next_line_shifted_2 |
void·a()
··{
····b();
··} |
next_line |
void·a()
{
··b();
} |
end_of_line |
void·a()·{
··b();
} |
end_of_line_no_space |
void·a(){
··b();
} |
Block under "case" label
Property names:
[resharper_]cpp_case_block_braces
, [resharper_]cpp_brace_style
, [resharper_]case_block_braces
, [resharper_]brace_style
Possible values:
-
next_line_shifted
: At next line indented (Whitesmiths style) -
next_line_shifted_2
: At next line indented 2 (GNU style) -
next_line
: At next line (BSD style) -
end_of_line
: At end of line (K&R style) -
end_of_line_no_space
: At end of line (no space)
Examples:
Other statements and blocks
Property names:
[resharper_]cpp_other_braces
, [resharper_]cpp_brace_style
, [resharper_]other_braces
, [resharper_]brace_style
Possible values:
-
next_line_shifted
: At next line indented (Whitesmiths style) -
next_line_shifted_2
: At next line indented 2 (GNU style) -
next_line
: At next line (BSD style) -
end_of_line
: At end of line (K&R style) -
end_of_line_no_space
: At end of line (no space)
Examples:
Other braces
Property names:
[resharper_]cpp_expression_braces
, [resharper_]expression_braces
Possible values:
-
outside_and_inside
: Parenthesis 1x, inside 2x (GNU style) -
none
: No indent -
inside
: Inside parenthesis (BSD/K&R style) -
outside
: Parenthesis and inside equally (Whitesmiths style)
Examples:
outside_and_inside |
int·a[10]·=
··{
····1,·2,·3
··}; |
none |
int·a[10]·=
··{
··1,·2,·3
··}; |
inside |
int·a[10]·=
{
··1,·2,·3
}; |
outside |
int·a[10]·=
··{
··1,·2,·3
··}; |
Empty braces formatting
Property names:
[resharper_]cpp_empty_block_style
, [resharper_]empty_block_style
Possible values:
-
together_same_line
: Together on the same line -
together
: Place braces together -
multiline
: On different lines
Examples:
Keep simple compound statements in one line
Property names:
[resharper_]cpp_simple_block_style
, [resharper_]simple_block_style
Possible values:
Examples:
line_break |
int·foo()
{
··return·0;
} |
on_single_line |
int·foo()·{·return·0;·} |
do_not_change |
int·foo()·{·return·0;·} |