问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/45821469/how-to-keep-spaces-within-angle-brackets-of-c-casting-operators-in-visual-c