New user, some questions


I'm evaluating Resharper C++, have the following questions:

- when creating getters and setters, these are placed near the underlying members in the class declaration. I would like to have them in the 'public' section of the class, and the class members in a separate 'private' section. Is it possible to group them this way?

- Can the getter/setters be created each in a single line (braces and code in the same line)?

- Is there a way to select a block of code and surround it with {} or () ?

- I often find myself having to write std::tie() containing a list of all class member variables, as follows:

class T {
int m_X;
int m_Y;

auto Tuple() const
return std::tie(m_X, m_Y);

Can the (m_X, m_Y) be auto generated using a template?

- is there a way to convert a pair of separate function declaration + implementation into a single inline implementation?



Comment actions Permalink


- ReSharper does not try to be smart about placing newly generated member functions at the moment. When you generate a class member, it gets placed after the caret position (not near the underlying members for getters/setters).

- You could set the "Braces Layout | Keep simple compound statements in one line" formatting option (in ReSharper | Options | Code Editing | C++ | Formatting Style) to "Force put on single line", and getters/setters will be formatted on single line. In general, just select a block of code, then type Alt + Enter, select "Format selection | Configure" and R# will show you formatting options that affect the selected code snippet.

- To surround a block of code with {} type Alt+Enter and then select "Surround with block". For () select "Surround with | ()" or Ctrl + E, Ctrl + U ("Surround with template") and select the () template.

- Not at the moment. I'll try to add a new generator for it in the next release (

- No, please vote for It hasn't been implemented yet because it's not used so often as the reverse action of splitting an inline function into a declaration and an implementation, and because it will sometimes leave your code broken. E.g. if a type is used in the implementation but not visible from the class declaration, should R# add an include? What happens if the added include creates a circular dependency?

Thanks for trying out R++!

Comment actions Permalink

Ok, thanks for the fast and helpful support!


Please sign in to leave a comment.