Move Implementation to Source File

Refactoring with Move Implementation to Source File provides C/C++ users with a simple mechanism for moving the implementation of a method from a header to a source file. This refactoring is often invoked after running other refactorings that places implementations in the header for inline execution or subsequent moving to a source file, e.g. Encapsulate Field.

Hover over the implementation of a method in a header and select Move Implementation to Source File from the refactoring menu.

moveImplementation.png

A declaration is created in the header.

moveImplementationHeader.gif

The implementation is moved to the appropriate source file, after other implementations of the same class.

moveImplementationDone.png

Navigate after Move Implementation to Source File

Use the Navigate commands of Visual Assist X to jump between the header and source after Move Implementation to Source File. Immediately after the create, Alt+Left returns you to the header. Alt+Right returns you to the implementation.

Miscellaneous

Move Implementation to Source File is not available for inline methods outside the class definition.

Implementations of overloaded methods are moved near other overloads; they are not necessarily placed at the end of a class.

You can modify the format of implementations by editing the VA Snippets entries for Refactor Create Implementation.