Cor*_*son 32 c++ enums doxygen c++11
鉴于:
namespace Foo {
class Foo {
public:
/// Foo enum, possible ways to foo
enum class Foo {
/// Foo it with an A
A,
/// Foo it with a B
B,
/// Foo it with a C
C
}
}
}
Run Code Online (Sandbox Code Playgroud)
和默认的Doxyfile doxygen -g,我得到这个:

如何记录枚举值?我尝试在成员之前/之后发表评论,使用///<等等都无济于事.可能这只是doxygen中的一个错误?文档中的示例有效.(点击枚举名称不会带我到任何地方)
Mas*_*Man 24
使用Doxygen 1.8.2,以下两项工作对我而言:
运用 ///
/// This is an enum class
enum class fooenum {
FOO, ///< this is foo
BAR, ///< this is bar
};
Run Code Online (Sandbox Code Playgroud)
运用 /*! ... */
/*! This is an enum class */
enum class fooenum {
FOO, /*!< this is foo */
BAR, /*!< this is bar */
};
Run Code Online (Sandbox Code Playgroud)

该doxygen的更新日志说,enum class在Doxygen的1.8.2是支持的,所以我怀疑可能有一些小的语法问题你的命令.您可以将您的命令与上述两个片段进行比较吗?
新功能
添加了对C++ 11的支持:
Run Code Online (Sandbox Code Playgroud)strongly typed enums, e.g.: enum class E
请注意,我个人不喜欢有长篇的头文件(因为记录意味着写入至少2或3行文档,而不是一个单词因此我通常没有足够的内容)所以我更喜欢在文档中记录. cpp文件.
为此,您可以使用Doxygen的\ var功能.
所以标题是裸露的:
namespace Foo {
class Foo {
public:
enum class Foo {
A,
B,
C
};
};
}
Run Code Online (Sandbox Code Playgroud)
并且.cpp文件具有:
namespace Foo {
/** \enum Foo::Foo
* \brief Foo enum, possible ways to foo
*
* All the necessary details about this enumeration.
*/
/** \var Foo::A
* \brief Foo it with an A
*
* When you use A... etc.
*/
/** \var Foo::B
* \brief Foo it with an B
*
* When you use B... etc.
*/
/** \var Foo::C
* \brief Foo it with an C
*
* When you use C... etc.
*/
}
Run Code Online (Sandbox Code Playgroud)
这样,我可以真正地记录下我经常发生的事情.
The below style works for me:
enum class Foo {
/**Foo it with A*/
A,
/**Foo it with B*/
B
}
Run Code Online (Sandbox Code Playgroud)