Constructor and curly braces for default initialization

Hello,

maybe somebody can help me here. 

When I initialize variables in the ctor; I usually write something like this:

Class::Class() : mBool( false ),
mInt( 1 )
{
}

But everytime when I use the auto-complete for new variables, Resharper ( ? ) inserts me that:

Class::Class() : mBool( false ), 
mInt( 1 ),
mFloat{ }
{ }

You see the curly braces for 'mFloat' ?

So I need to delete them everytime and replace them with () which is very annoying...

Any idea how to change that behaviour?

I'm using VS 2015 with the latest version of Resharper.

Best regards,

Alex

0
2 comments
Avatar
Permanently deleted user

Hello Alex,

You need to turn off the "Use uniform initialization in member initializers" setting in ReSharper | Options | Code Editing | C/C++ | Code style.

Regards,

Igor

0

Hello Igor,

Perfect!

I would propose to extend the 'visual help' on this page. Just like on the 'Formatting Style' pages.

Thank you,

Alex

0

Please sign in to leave a comment.