visual-studio-2015resharperresharper-c++

Refactor function from non-inline to inline


Is there any command in Resharper for c++ (or maybe in Visual Studio itself) to make non-inline function as inline?

For example I have function Foo declared in Foos.h and defined in Foos.cpp. Now I wanna have it's defined in Foos.h, i.e. exactly where it was initially declared.

I found it kinda hard to google because of similar named Resharper "Inline method refactoring" functionality (ctrl+R,I). Thanks!


Solution

  • ReSharper C++ does not have an action like that at the moment. The primary reason is it might not always be possible to do that because some entities used in the function definition are not visible from the function declaration point (and adding required includes might cause cyclic dependencies), so the action will break your code. If you often need an action like that, please vote for https://youtrack.jetbrains.com/issue/RSCPP-19679 and we'll implement it in some form in a future release.