开发者

How to comment C++ code so that comments would be visible in IntelliSense

In C# if I want to comment a function I just press / three times and appropriate tags appear above a function. Everything I write in this tag is then shown in IntelliSense so I can easily see what the given 开发者_如何学Cfunction does.

However in C++ there is no such tags, so how can I comment code so that my comment would be recognized by IntelliSense?

I was trying two backslashes above function

    //
    //here goes the comment
    //
    void* Foo(){}

but it didn't do the trick.


You can still use /// in Visual C++ - the IDE doesn't give you the template XML though.


This link clams you can add code documentation comments and generate intellisense readable files from an externally generated XML file.


I am fairly sure that the commenting system that lets you add data to functions might actually be part of the C# spec. Could be smoking this one up though.

As for getting that feature for C++ you are just going to have to put up with the fact that MS basically shaft any other language other then C#. More or less any cool intelisense feature is deliberately not implimented for C++.

Some features are sort of scripted using XML files, features such as creating C# code from UML diagrams. I did look into it, and in theory you can make your own C++ version for these features. Some one else may have already done it.

Sorry about this sort of non-answer, but basically, visual studio doesn't support (at least not natively) doing anything clever with comments for C++, other then adding and removing them for multiple lines at once.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜