Create Implementation

Refactoring with Create Implementation provides C/C++ users with an efficient mechanism for creating implementation stubs from declarations of methods. Parameters between the declaration and implementation are certain to be consistent, and the format of the implementation is consistent with user preferences.

Hover over a method in a header and select Create Implementation from the refactoring menu.

createImplementation.gif

An implementation stub is placed in the appropriate source file, after other implementations of the same class.

createImplementationDone.gif

Format of Implementations

You can modify the format of newly created implementations, e.g. to remove spacing around parentheses, by editing the VA Snippets entries for Refactor Create Implementation. There are separate VA Snippets for C++, C# and VB. (The entries for C# and VB are used only by other refactorings, e.g. Change Signature.)

The VA Snippets entry for Create Implementation is used also by Move Implementation to Source File.

The VA Snippets entries include special characters expanded only when refactoring. These special characters are:

Reserved StringMeaning
$SymbolContext$Context and name of method
$SymbolType$Return type of method
$ParameterList$Parameters separated by commas
$MethodQualifier$Optional qualifiers of method
$MethodBody$Body of implementation

$MethodBody$ is resolved when this entry is used by Move Implementation to Source File, and when running Extract Method inside pure C.

If you delete the VA Snippets entry and invoke Create Implementation, a default entry is created for you.

Navigate after Create Implementation

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

Miscellaneous

If an appropriate source file for an implementation cannot be found, the implementation is placed in the header. Use copy and paste to move the implementation to a different file.

Create Implementation is available whether or not an implementation exists.