Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Auto Class Implementation in Editor

Tags:

c++

editor

Much of my time spent developing C++ applications is wasted implementing class definitions. By that I mean the prototyping of classes then creating their respective implementations.

For example:

#ifndef FOO_H
#define FOO_H

class Foo
{
public:
   Foo (const X& x, const Y& Y);
   ~Foo ();

   void PerformXYZ (int Count);
};

#endif

And now I'll have to copy and paste, then add the repetitive Foo:: onto each function.

Foo::Foo (const X& x, const Y& Y)
{

}

Foo::~Foo ()
{

}

void Foo::PerformXYZ (int Count)
{

}

For now I copy the function declarations over to their respective *.cpp files, remove empty lines, then replace ';' with "\n{\n\n}\n". However, I still have to specify the namespace for each function.

Are there tools in Eclipse, Vim or any other IDE/editor that take this burden off a developer?

like image 658
Hakkar Avatar asked Jul 20 '09 04:07

Hakkar


1 Answers

In Visual Studio there are tools to add functions and variable. Tools automates the process in question. But I never use them :)

In the Visual Assist X there is the feature that helps to add implementation for methods. It is the best solution.

like image 142
Kirill V. Lyadvinsky Avatar answered Sep 21 '22 22:09

Kirill V. Lyadvinsky