Automatic generation of function stubs

2019-05-10 05:06发布

问题:

Is there any Visual Studio add-on (or windows/unix stand-alone program) that creates stub implementations in the cpp file for the functions (including class member functions) that are defined in the header file?

回答1:

I have the same problem before and now I am using trial version of Visual Assist X. The task mentioned can be done by right clicking on the method name -> Refactor -> Create Implementation and then Refactor -> Move Implementation to CPP file.

I am no Visual Assist X's affiliate or what, but this really increases my coding speed with Visual C++ dramatically.



回答2:

Refactor! for C++ works with Dev Studio 2005 and 2008. The free version "kind-of" let's you do this; if you type your stub method in your header file (by typing something like void Foo(int bar){} instead of void Foo(int bar);) you can then "Move method to source file."

The full version has many more features but I'm not familiar with their usage.