问题描述:

I just switched back to c++ after leaving it for awhile and I can't seem to remember how to make nice function/class comment boxes in VS. What I'm looking for is something like this:

/**

* Convenience struct: coord

* -------------------------

* Simple C++ struct (which is like a class, except there are

* no methods and everything is public) that bundles two related

* pieces of data together.

*/

struct coord {

int row;

int col;

};

I don't, however, want to have to format out the nice starring and alignment every time I want to write a new comment. I feel like I used to be able to just type '/**' and then hit return and it would automatically make a comment section for me where every time I hit return a new star would appear aligned with the others. Is there a way to activate this in VS 2010?

网友答案:

Visual Assist is the tool you require. If you can move away from MSVC IDE, can try Eclipse also.

网友答案:

You should be able to record a nice macro to do this, then bind it to an unused button/shortcut key combo and your set, else its pretty trivial to code a simple VS plugin to do this with some extra embelishments

网友答案:

Try GhostDoc for a starting point. It is fairly configurable and gives you a documentaion template with one hotkey sequence.

[Edit]

I mistook this for a C# question. As Billy pointed out, GhostDoc is not a good solution for C++ in VS.

Try this SO question about "GhostDoc for C++?" for some other ideas.

相关阅读:
Top