Laurent Couvidou
Laurent Couvidou

Reputation: 33678

How to keep spaces within angle brackets of C++ casting operators in Visual C++ 2015?

I want to format my C++ casting operators this way:

Class * foo = static_cast< Class * >( bar );

Visual Studio insists on removing the spaces within the angle brackets:

Class * foo = static_cast<Class*>( bar );

How do I prevent it from doing so?

Upvotes: 3

Views: 1399

Answers (1)

Laurent Couvidou
Laurent Couvidou

Reputation: 33678

Go to Options > Text Editor > C/C++ > Formatting > Spacing, and check the (wrongly named) Insert space within parentheses of a C-style cast box. For some reason, it also applies to the angle brackets of C++ casting operators.

Where's the damn setting?

Upvotes: 5

Related Questions