Doxygen无法解析模板化的返回类型 [英] Doxygen fails to parse templated return type
问题描述
我目前正在用Doxygen记录我的代码。看起来好像Doxygen不能处理模板化的返回值。我的问题:
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
第二个函数没有记录。更糟;下面的所有功能现在被Doxygen跳过。 doxygen似乎不能处理 list< pair< int,int>>
返回值。
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.
推荐答案
也许Doxygen不支持声明模板的新方法?旧的C ++标准(我认为高达C ++ 03),只允许 list< pair< int,int& >
。你应该在两个>
符号之间有一个空格,因为否则编译器会将它们解释为>>
(右移)运算符。
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.
一些较新的编译器重新使用这种语法,它是即将到来的C ++ 0x标准的一部分,但也许doxygen doesn' t认识它。
Some newer compilers regonize this syntax, and it is part of the upcoming C++0x standard, but maybe doxygen doesn't recognize it yet.
这篇关于Doxygen无法解析模板化的返回类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!