Code Style
Preferences configurable on this page are taken into account when ReSharper produces new code with code completion and code generation features, applies code templates and performs refactorings. They can also be applied to the existing code by using code cleanup with the corresponding settings.
Item | Description |
---|---|
Include directives | |
Use forward slash in include directives | Use this check box to choose the preferred path separator for include directives: forward slash or backward slash. |
Prefer to use forward declarations if possible | If this option is selected, the new items are created with the forward declaration in the header file. |
Use paths relative to the source file | You can use this selector to configure how ReSharper inserts paths to source files when importing types with a quick-fix or with import symbol completion. |
Use angle brackets instead of quotes | By default, generated include directives are added in quotes, if necessary, you can use this selector to specify cases where generated include directives are added in angle brackets. |
Position of cv-qualifiers | |
Put cv-qualifiers before type | If this option is selected, the const , volatile , and mutable qualifiers are put before the type specifier. Otherwise, they are put after the type specifier. |
Put 'const' before 'volatile' | Defines the order of cv-qualifiers. |
Initialization | |
Default pointer initializer | You can specify 0 , nullptr or NULL as the preferred initializer for pointer initializers, e.g.: const char *foo = nullptr . |
Use uniform initialization in member initializers | By default, ReSharper uses C++03 style when generating initializers (e.g. when you generate constructors or apply a quick-fix that inserts initializer into an existing constructor). You can select this check box to enable uniform initialization in the above mentioned cases. |
Last modified: 14 December 2017
See Also
Procedures:
- Naming Style
- Managing and Applying Code Formatting Rules
- File and Type Layout
- File Header Style
- Code Syntax Style: Namespace Imports
- Code Syntax Style: Implicit/Explicit Typing
- Using Auto-Properties
- Making Fields Readonly
- Code Syntax Style: Multiple Attributes
- Code Syntax Style: Modifiers
- Code Syntax Style: Optional Member Qualifiers
- Reformatting XML Doc Comments
- Removing Code Redundancies