Shortcut for std::to_string?


Unfortunately, I think I messed something up and my original post didn't go through.

I was wondering if there is a way to create a shortcut for std::to_string similar to what ReSharper does with highlighted text and entering brackets where it inserts at the beginning and end of the highlight.

Simple Example:

int x = 10;
int y = 15;
int components = 12;
int index = 0;

PrintFunction(const std::string& msg){....}

PrintFunction( index + " " + x + " " + y + " " + components);

Highlighting index and bringing up context menu and automatically changing index to std::to_string(index) etc.

I hope that makes sense, I thought ReSharper did this, but I can't find anything on it. Perhaps it can be done within ReSharper options using some of those more complicated functionality ReSharper provides? Custom?



I guess ReSharper doesn't have a way to solve this. Thanks, anyways.


For those interested, I was able to create something in ReSharpers Template Explorer. I just used


for the code.

I'm trying to figure out how I can use it now without needing to go through 3 menus to select it.


Hi Ledloaf,
I've created a feature request for the corresponding context action:
You can upvote the ticket to get a notification when it's implemented. Thanks!


There is a special `to_string` item in ReSharper postfix completion (

Press '.' after expression of integer type ('index' for instance):

and after completion of item 'to_string' code will be the following:


Please sign in to leave a comment.