如何@ref同一方法的不同变体?



我正在为一些C++代码编写doxygen注释。我有两个功能:

/** Some existing doxygen comment */
int foo(int x);
/** Another existing doxygen comment */
int foo(
this_signature y1,
is_really_long y2, 
and_to_be_honest y3, 
i_would y4, 
really_rather y5, 
avoid_repeating_it y6);
/** This is what I'm writing now */
int foo(double z);

在第二个函数的doxygen注释中,我想@ref引用第二个函数,或者更确切地说是函数的第二个变体。我该怎么做?

注意:我特别(不仅仅是机器人(对不会非常冗长的解决方案感兴趣(考虑到第二个函数的长签名(。

它(就像@Scheff写的那样(可以通过签名进行引用。所以像这样:

/** Fie to show reference:
*
* ref foo(unsigned long)
*
* ref foo(unsigned long y)
*/
void fie(void);

另请参阅 http://www.doxygen.nl/manual/autolink.html#linkfunc。

关于长签名的评论,要么按照@Scheff的建议使用anchor可能性,但在我看来,起初它看起来是一个很好的解决方案,但它的可维护性较差(在生成文档时检查签名变体是否存在,但anchorref中的字符串不是(您可能需要类似的东西:ref my_anch "foo(unsigned long y)"否则(ref my_anch(链接的名称为my_anch

最新更新