C++ unwanted spaces between braces

John Hite 41 Reputation points
2021-10-19T04:13:45.54+00:00

When I type
int i{3}

The editor presumes I want
int i{ 3 }

The editor would be wrong.

Please make it stop!

Something could be done about tags too. I had to guess around until I found something that would be accepted and its not really relevant. At least give us a list to choose from, please.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,540 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 112.5K Reputation points
    2021-10-19T04:32:54.82+00:00

    You can make it stop yourself: in Visual Studio 2019, go to menu, TOOLS, Options, Text Editor, C/C++, Code Style, Formatting, Spacing, Spacing for braces, and uncheck "Insert space within braces of uniform initialisation and initialiser lists". You will also find more options that can be adjusted to your personal needs.

    To reformat the existing code after these changes, press <Ctr+E, D>.


0 additional answers

Sort by: Most helpful