Doxygen 无法解析模板化返回类型

发布于 2024-11-01 06:34:24 字数 695 浏览 5 评论 0 原文

我目前正在使用 Doxygen 记录我的代码。看起来 Doxygen 无法处理模板化返回值。我的问题:

/** 
 *  Retrieves all edges from the graph.
 *  @param gID The ID of the graph.
 *  @return A list containing pairs of vertices, denoting the edges in the graph.
 */
 int GetEdges(const int& gID); // Works fine

/** 
 *  Retrieves all edges from the graph.
 *  @param gID The ID of the graph.
 *  @return A list containing pairs of vertices, denoting the edges in the graph.
 */
 list<pair<int,int>> GetEdges(const int& gID); // PROBLEM

第二个函数没有记录。更糟糕的是;现在,Doxygen 会跳过它下面的所有函数。不知何故,doxygen 似乎无法处理 list> 返回值。

有谁知道为什么以及如何改变这个?先感谢您。

I'm currently documenting my code with Doxygen. It seems though as if Doxygen cannot handle templated return values. My problem:

/** 
 *  Retrieves all edges from the graph.
 *  @param gID The ID of the graph.
 *  @return A list containing pairs of vertices, denoting the edges in the graph.
 */
 int GetEdges(const int& gID); // Works fine

/** 
 *  Retrieves all edges from the graph.
 *  @param gID The ID of the graph.
 *  @return A list containing pairs of vertices, denoting the edges in the graph.
 */
 list<pair<int,int>> GetEdges(const int& gID); // PROBLEM

The second function does not get documented. Even worse; all functions below it are now skipped by Doxygen. Somehow doxygen doesn't seem to be able to handle the list<pair<int,int>> return value.

Does anybody know why and how to change this? Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情归归情 2024-11-08 06:34:24

也许 Doxygen 不支持声明模板的新方式?较旧的 C++ 标准(我认为直到 C++03)仅允许 list >。末尾的两个 > 符号之间应该有一个空格,否则编译器会将它们解释为 >> (右移)运算符。

一些较新的编译器重新调整了此语法,它是即将推出的 C++0x 标准的一部分,但也许 doxygen 还无法识别它。

Maybe Doxygen doesn't support the new way of declaring templates? Older C++ standards (I think up to C++03), allow only list<pair<int,int> >. You should have a space between the two > signs at the end, because otherwise the compiler will interpret them as a >> (right shift) operator.

Some newer compilers regonize this syntax, and it is part of the upcoming C++0x standard, but maybe doxygen doesn't recognize it yet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文