如何编写显示在Intellisense中的C ++注释? [英] How to write C++ comments that show up in Intellisense?
问题描述
根据 MSDN ,我只需要在声明之前或在同一行之后放置评论。所以我试过这个:
//这是一个测试。
void foo();
void bar(){foo();
将鼠标移到 foo()
,该注释不会显示在工具提示中。我也试过:
-
///
-
< summary>< / summary>
标签 - 使用
/ doc
(通过在项目设置中设置生成XML文档文件选项)
我迄今没有运气。有没有人知道这样做的方法?
现在支持VS 2012!
以前,注释中的XML标签只能被C ++ / CLI读入,而不是纯旧的C ++。
VS 2012现在至少将其中的一些转化为常规C ++ - 它位于Visual Studio 2012的新功能,MSDN文档中的XML文档(Visual C ++)。
我已经在2012年的自己的应用程序中测试了,我可以确认摘要,para和seealso标签都被拉出,用于工具提示格式化。
I'm programming in C++ using Visual Studio 2010 Ultimate. I want to document some functions and I want the documentation to show up in Intellisense.
According to MSDN, I just need to put the comment before the declaration or after it on the same line. So I tried this:
// This is a test.
void foo();
void bar() { foo(); }
When moving my mouse over foo()
, the comment doesn't appear in the tooltip. I also tried:
///
<summary></summary>
tags- Building with
/doc
(by setting the "Generate XML documentation files" option in the project settings)
I've had no luck so far. Does anyone know a way to make this work?
This now supported in VS 2012!
Previously, XML tags in the comments were only read in by C++/CLI, not plain old C++. VS 2012 now brings at least some of this into regular C++ - it is in the "What's New in Visual Studio 2012" and in the MSDN docs as "XML Documentation (Visual C++)" under "".
I've tested it with my own application in 2012 ultimate, and I can confirm that the summary, para, and seealso tags are all pulled out an formatted for tooltips.
这篇关于如何编写显示在Intellisense中的C ++注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!