C++ 我应该如何使用 Doxygen 对 typedef 进行分类?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7933060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How should I classify a typedef with Doxygen?
提问by Questioneer
I have typedef structs in my C++ code. As of right now they are listed as \var
typedef. Is there a better way to do this? Below is example of what I have:
我的 C++ 代码中有 typedef 结构。截至目前,它们被列为\var
typedef。有一个更好的方法吗?以下是我所拥有的示例:
/*! \var typedef etc
* \brief A type defined structure for etc
*
* \param x type- Variable declaration for x
* \param y type- Variable declaration for y
*/
I know I shouldn't even be saying param
. What else is there to use?
我知道我什至不应该说param
。还有什么用?
回答by doxygen
If you put the comment block in front of the typedef you don't need to use any special command.
如果将注释块放在 typedef 前面,则不需要使用任何特殊命令。
/** This is the documentation for the following typedef */
typedef MyClass MyTypedef;
If you prefer to put it after the typedef use the following:
如果您更喜欢将它放在 typedef 之后,请使用以下命令:
typedef MyClass MyTypedef;
/**< This is the documentation for the preceding typedef */
Only when the comment block must be at a different location than the actual typedef, you need to use \typedef.
只有当注释块必须与实际的 typedef 位于不同的位置时,才需要使用 \typedef。
回答by Thomas Matthews
According to the Doxygen documentationthere is a \typedef
command. The command behaves the same as the \var
command.
根据Doxygen 文档,有一个\typedef
命令。命令的行为与命令相同\var
。