【问题标题】:Template specialisation of a static function is shown in Doxygen-genered documentation静态函数的模板特化显示在 Doxygen 生成的文档中
【发布时间】:2014-01-25 14:21:40
【问题描述】:

在我的项目的 C++ 标头中,我使用了一些在非静态公共函数中调用的静态模板函数助手。

当我在这个文件上运行 Doxygen 时,即使使用模板,每个静态函数也会被隐藏,这是正确的行为,因为静态函数对于外界是不可见的。但是当我对其中一个进行模板专业化时,这个专业化将出现在生成的文档中:

// This will not appear in documentation, ok
template<class T>
static T my_function(...)

// However this will appear ! :(
template<>
SomeClass my_function(...)

如果认为这是因为 Doxygen 不够聪明,无法看出这种特化是针对静态函数的,所以这种特化看起来像一个普通的特化。但也许我错了。

我该怎么做才能从我的文档中隐藏它?

【问题讨论】:

    标签: c++ templates doxygen template-specialization


    【解决方案1】:

    始终可以使用 @cond 和 @endcond 在代码周围隐藏 Doxygen 的代码部分。

    它是 #if 0 / #endif 的 doxygen 等价物

    【讨论】:

      猜你喜欢
      • 2013-05-30
      • 2010-10-20
      • 1970-01-01
      • 2014-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-16
      相关资源
      最近更新 更多