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

故事扮演 提交于 2019-12-11 01:38:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!