C++ - Braces Layout
Last modified: 21 July 2022Braces layout
Namespace declaration
Property names:
[resharper_]cpp_namespace_declaration_braces
, [resharper_]cpp_brace_style
, [resharper_]namespace_declaration_braces
, [resharper_]brace_style
Possible values:
end_of_line
: At end of line (K&R style)end_of_line_no_space
: At end of line (no space)next_line
: At next line (BSD style)next_line_shifted
: At next line indented (Whitesmiths style)next_line_shifted_2
: At next line indented 2 (GNU style)
Examples:
end_of_line |
---|
|
end_of_line_no_space |
---|
|
next_line |
---|
|
next_line_shifted |
---|
|
next_line_shifted_2 |
---|
|
Linkage specifications
Property names:
[resharper_]cpp_linkage_specification_braces
, [resharper_]cpp_brace_style
, [resharper_]linkage_specification_braces
, [resharper_]brace_style
Possible values:
end_of_line
: At end of line (K&R style)end_of_line_no_space
: At end of line (no space)next_line
: At next line (BSD style)next_line_shifted
: At next line indented (Whitesmiths style)next_line_shifted_2
: At next line indented 2 (GNU style)
Examples:
end_of_line |
---|
|
end_of_line_no_space |
---|
|
next_line |
---|
|
next_line_shifted |
---|
|
next_line_shifted_2 |
---|
|
Type declaration
Property names:
[resharper_]cpp_type_declaration_braces
, [resharper_]cpp_brace_style
, [resharper_]type_declaration_braces
, [resharper_]brace_style
Possible values:
end_of_line
: At end of line (K&R style)end_of_line_no_space
: At end of line (no space)next_line
: At next line (BSD style)next_line_shifted
: At next line indented (Whitesmiths style)next_line_shifted_2
: At next line indented 2 (GNU style)
Examples:
end_of_line |
---|
|
end_of_line_no_space |
---|
|
next_line |
---|
|
next_line_shifted |
---|
|
next_line_shifted_2 |
---|
|
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 |
---|
|
false |
---|
|
Function declaration
Property names:
[resharper_]cpp_invocable_declaration_braces
, [resharper_]cpp_brace_style
, [resharper_]invocable_declaration_braces
, [resharper_]brace_style
Possible values:
end_of_line
: At end of line (K&R style)end_of_line_no_space
: At end of line (no space)next_line
: At next line (BSD style)next_line_shifted
: At next line indented (Whitesmiths style)next_line_shifted_2
: At next line indented 2 (GNU style)
Examples:
end_of_line |
---|
|
end_of_line_no_space |
---|
|
next_line |
---|
|
next_line_shifted |
---|
|
next_line_shifted_2 |
---|
|
Lambda expression
Property names:
[resharper_]cpp_anonymous_method_declaration_braces
, [resharper_]cpp_brace_style
, [resharper_]anonymous_method_declaration_braces
, [resharper_]brace_style
Possible values:
end_of_line
: At end of line (K&R style)end_of_line_no_space
: At end of line (no space)next_line
: At next line (BSD style)next_line_shifted
: At next line indented (Whitesmiths style)next_line_shifted_2
: At next line indented 2 (GNU style)
Examples:
end_of_line |
---|
|
end_of_line_no_space |
---|
|
next_line |
---|
|
next_line_shifted |
---|
|
next_line_shifted_2 |
---|
|
Block under "case" label
Property names:
[resharper_]cpp_case_block_braces
, [resharper_]cpp_brace_style
, [resharper_]case_block_braces
, [resharper_]brace_style
Possible values:
end_of_line
: At end of line (K&R style)end_of_line_no_space
: At end of line (no space)next_line
: At next line (BSD style)next_line_shifted
: At next line indented (Whitesmiths style)next_line_shifted_2
: At next line indented 2 (GNU style)
Examples:
end_of_line |
---|
|
end_of_line_no_space |
---|
|
next_line |
---|
|
next_line_shifted |
---|
|
next_line_shifted_2 |
---|
|
Requires expressions
Property names:
[resharper_]cpp_requires_expression_braces
, [resharper_]requires_expression_braces
Possible values:
end_of_line
: At end of line (K&R style)end_of_line_no_space
: At end of line (no space)next_line
: At next line (BSD style)next_line_shifted
: At next line indented (Whitesmiths style)next_line_shifted_2
: At next line indented 2 (GNU style)
Examples:
end_of_line |
---|
|
end_of_line_no_space |
---|
|
next_line |
---|
|
next_line_shifted |
---|
|
next_line_shifted_2 |
---|
|
Other statements and blocks
Property names:
[resharper_]cpp_other_braces
, [resharper_]cpp_brace_style
, [resharper_]other_braces
, [resharper_]brace_style
Possible values:
end_of_line
: At end of line (K&R style)end_of_line_no_space
: At end of line (no space)next_line
: At next line (BSD style)next_line_shifted
: At next line indented (Whitesmiths style)next_line_shifted_2
: At next line indented 2 (GNU style)
Examples:
end_of_line |
---|
|
end_of_line_no_space |
---|
|
next_line |
---|
|
next_line_shifted |
---|
|
next_line_shifted_2 |
---|
|
Other braces
Property names:
[resharper_]cpp_expression_braces
, [resharper_]expression_braces
Possible values:
inside
: Inside parenthesis (BSD/K&R style)outside
: Parenthesis and inside equally (Whitesmiths style)outside_and_inside
: Parenthesis 1x, inside 2x (GNU style)none
: No indent
Examples:
inside |
---|
|
outside |
---|
|
outside_and_inside |
---|
|
none |
---|
|
Empty braces formatting
Property names:
[resharper_]cpp_empty_block_style
, [resharper_]empty_block_style
Possible values:
multiline
: On different linestogether
: Place braces togethertogether_same_line
: Together on the same line
Examples:
multiline |
---|
|
together |
---|
|
together_same_line |
---|
|
Keep simple compound statements in one line
Property names:
[resharper_]cpp_simple_block_style
, [resharper_]simple_block_style
Possible values:
do_not_change
: Do not changeon_single_line
: Force put on single lineline_break
: Force line breaks
Examples:
do_not_change |
---|
|
on_single_line |
---|
|
line_break |
---|
|
Regular expression for macros starting a block
Property names:
[resharper_]cpp_macro_block_begin
, [resharper_]macro_block_begin
Regular expression for macros ending a block.
Property names:
[resharper_]cpp_macro_block_end
, [resharper_]macro_block_end