<分区>
有没有方便的方法在 doxygen 中记录 C++ 概念?我想要一些类似 this in the boost documentation 的文档.
<分区>
有没有方便的方法在 doxygen 中记录 C++ 概念?我想要一些类似 this in the boost documentation 的文档.
最佳答案
在与 Doxygen 斗争之后,我终于得出了以下解决方案。
为您的概念定义一个组:使用页面不太合适,因为一个页面应该指示其子页面(从树的顶部到底部),而组指示可能有许多父组。这允许:
例子
/*!@defgroup measurement_functor_concepts Measurement function objects
* @ingroup generalconcepts
* @{
* @par Description
* blablabla
*
* @par Notations
* Let @c F be the type of the function object, @c f an instance.
*
* @par Valid Expressions
* - @c f function object is ...
* - <b>f.result()</b> returns ...
* @}
*/
使用一个参数定义自定义命令概念
:
ALIASES += concept{1}="@ingroup \1\n@par Implemented concepts:\n@ref \1"
命令:
Implemented concepts
的段落,提供指向已实现概念的链接。表明一个特定的类/结构实现了这个概念:
//!@brief Does things...
//!@concept{measurement_functor_concepts}
template <class T>
struct my_struct: public std::unary_function<T, void> {};
我没有找到一种方法来生成像 Boost 中那样好的文档(用于有效表达式的漂亮表格等),但至少这种文档组织可以正确地将内容分开。
关于c++ - 使用 doxygen 记录 C++ 概念?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10087171/