引用命名空间中声明的静态常量变量
我正在充实我的模块的 doxygen 文档,并遇到了一个奇怪的问题。当引用位于命名空间中的变量时,自动链接不起作用。这是一个片段:
namespace isa {
const double H_max= 10000; //!< @brief Maximum altitude in meters.
//! @brief Calculate air densitity at altitude \a H.
//! @throw argument_exception when \a H exceeds ::H_max.
double rho(double H);
} // namespace isa
我希望 doxygen 在函数 rho(double) 的异常描述处放置一个指向 H_max 的链接,以引导读者找到该常量。但只有当我离开名称空间时它才会起作用,否则自动链接将不起作用。
我做错了什么?
提前致谢。
I am fleshing out the doxygen documentation for my modules and came across a strange problem. When referencing variables located in a namespace autolinking does not work. Here is a snippet:
namespace isa {
const double H_max= 10000; //!< @brief Maximum altitude in meters.
//! @brief Calculate air densitity at altitude \a H.
//! @throw argument_exception when \a H exceeds ::H_max.
double rho(double H);
} // namespace isa
I would expect doxygen to put a link to H_max at the exception description of function rho(double) to direct the reader to the constant. But it only does if I leave away the namespace, otherwise autolinking does not work.
What am I doing wrong?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,所以这里的问题不是 doxygen 的错误行为,而是对全局命名空间前缀
::
工作方式的误解。::H_max
标识在全局命名空间中定义的符号,即在任何命名空间之外。恐怕 - 如果我错了,请纠正我 - 您希望它充当父目录..
标识符。当 doxygen 处理您提供的代码片段时,它不会链接异常描述中的
::H_max
,因为它在全局命名空间中找不到H_max
变量。如果删除双冒号前缀,它应该提供指向isa::H_max
的链接。OK, so the problem here is not a doxygen wrong behavior, but a misunderstanding on how the global namespace prefix
::
works.::H_max
identifies a symbol defined in the global namespace, that is, out of any namespace. I'm afraid - correct me if I'm wrong - that you where expecting it to behave as the parent directory..
identifier.When doxygen processes the code snippet you provided, it doesn't link
::H_max
in the exception description because it cannot find aH_max
variable in the global namespace. If you remove the double colon prefix, it should provide a link toisa::H_max
.