ReSharper 2017.1 Help

C++ - Line breaks and Wrapping

Place on new Line

Place "else" on new line after compound statement

Property names:

[resharper_]cpp_new_line_before_else, [resharper_]new_line_before_else

Possible values:

true | false

Examples:

true
if·(true) { ··foo(); } else { ··foo(); }
false
if·(true) { ··foo(); else { ··foo(); }

Place "while" on new line after compound statement

Property names:

[resharper_]cpp_new_line_before_while, [resharper_]new_line_before_while

Possible values:

true | false

Examples:

true
do { ··foo(); } while·(true);
false
do { ··foo(); while·(true);

Place "catch" on new line after compound statement

Property names:

[resharper_]cpp_new_line_before_catch, [resharper_]new_line_before_catch

Possible values:

true | false

Examples:

true
try { ··foo(); } catch·(...) { ··foo(); }
false
try { ··foo(); catch·(...) { ··foo(); }

Place enumerators on new line

Property names:

[resharper_]cpp_new_line_before_enumerators, [resharper_]new_line_before_enumerators

Possible values:

true | false

Examples:

true
enum { ··FOO, ··BAR };
false
enum { ··FOOBAR };

Break line in single embedded statement

Property names:

[resharper_]cpp_simple_embedded_statement_style, [resharper_]simple_embedded_statement_style

Possible values:

  • line_break: Force line breaks
  • on_single_line: Force put on single line
  • do_not_change: Do not change

Examples:

line_break
if·(true) ··foo(); else ··foo();
on_single_line
if·(truefoo(); else·foo();
do_not_change
if·(truefoo(); else ··foo();

Break line in simple "case" statement

Property names:

[resharper_]cpp_simple_case_statement_style, [resharper_]simple_case_statement_style

Possible values:

  • line_break: Force line breaks
  • on_single_line: Force put on single line
  • do_not_change: Do not change

Examples:

line_break
switch·(a) { case·b: ··break; case·c: ··break; }
on_single_line
switch·(a) { case·bbreak; case·cbreak; }
do_not_change
switch·(a) { case·bbreak; case·c: ··break; }

Break line after function definition return type

Property names:

[resharper_]cpp_function_definition_return_type_style, [resharper_]function_definition_return_type_style

Possible values:

  • line_break: Force line breaks
  • on_single_line: Force put on single line
  • do_not_change: Do not change

Examples:

line_break
int* foo()·return·0} char* bar()·return·0}
on_single_line
intfoo()·return·0} charbar()·return·0}
do_not_change
intfoo()·return·0} char* bar()·return·0}

Break line after function declaration return type

Property names:

[resharper_]cpp_function_declaration_return_type_style, [resharper_]function_declaration_return_type_style

Possible values:

  • line_break: Force line breaks
  • on_single_line: Force put on single line
  • do_not_change: Do not change

Examples:

line_break
struct·Boo { ··int* ··foo(); ··char* ··bar(); };
on_single_line
struct·Boo { ··intfoo(); ··charbar(); };
do_not_change
struct·Boo { ··intfoo(); ··char* ··bar(); };

Break line before member initializer list

Property names:

[resharper_]cpp_member_initializer_list_style, [resharper_]member_initializer_list_style

Possible values:

  • line_break: Force line breaks
  • on_single_line: Force put on single line
  • do_not_change: Do not change

Examples:

line_break
struct·X { ··X() ····x(0) ··{ ··} ··X(int·x) ····x(x) ··{ ··} ··int·x; };
on_single_line
struct·X { ··X()x(0) ··{ ··} ··X(int·x)x(x) ··{ ··} ··int·x; };
do_not_change
struct·X { ··X()x(0) ··{ ··} ··X(int·x) ····x(x) ··{ ··} ··int·x; };
Last modified: 4 July 2017