【问题标题】:Doxygen fails to parse templated return typeDoxygen 无法解析模板化的返回类型
【发布时间】:2011-08-04 22:22:03
【问题描述】:

我目前正在使用 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&lt;pair&lt;int,int&gt;&gt; 返回值。

有人知道为什么以及如何改变这种情况吗?提前谢谢你。

【问题讨论】:

  • 我很确定它可以,我的一些 doxygen 记录的代码使用模板返回类型。您是否为 C++ 设置了 doxygen 并启用了 STL 选项?
  • 我没有勾选该选项。它仍然没有为我提供解决方案。

标签: c++ return doxygen


【解决方案1】:

也许 Doxygen 不支持声明模板的新方式?较旧的 C++ 标准(我认为是 C++03),只允许 list&lt;pair&lt;int,int&gt; &gt;。最后的两个&gt; 符号之间应该有一个空格,否则编译器会将它们解释为&gt;&gt;(右移)运算符。

一些较新的编译器重新定义了这种语法,它是即将到来的 C++0x 标准的一部分,但可能 doxygen 还不能识别它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多