c++ - Fast way to generate code functions from header functions in Visual Studio? -
this question has answer here:
this may minor question, solution save me lot of time , prevent mistakes.
i working on c++ project in visual studio. if define function in class in header file, say
void initbutton(int buttonnum);
i copy , paste signature cpp file. then, insert class name, , replace semi-colon curly braces, so:
void button::initbutton() { }
however, i'll forget class name, or accidentally type before return type. happens static variables need define in code. seems small, piles since i'm @ beginning phase of project. there quicker way auto-generate these in visual studio c++? or best practice i'm missing out on?
edit: appears has been asked before: auto-create implementation in visual studio c++ 2010
edit 2: best solution me appears here: http://www.radwin.org/michael/2011/05/10/stubgen/
in visual studio 2015 there's "quick actions" feature, light bulb shows whenever hover on piece of code. in header file 1 of options "create definition of ... in ....cpp". option generates function definition in corresponding header file.
Comments
Post a Comment