2011-04-13 165 views
3

我目前正在使用Doxygen記錄我的代碼。看起來好像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<pair<int,int>>的返回值。

有人知道爲什麼以及如何改變這種情況嗎?先謝謝你。

+0

我很確定它可以,我的一些doxygen記錄的代碼使用模板返回類型。您是否爲C++設置了doxygen並啓用了STL選項? – ssube 2011-04-13 18:19:49

+0

我沒有選擇該選項。它仍然沒有爲我提供解決方案。 – 2011-04-14 07:18:01

回答

3

也許Doxygen不支持聲明模板的新方法?較早的C++標準(我認爲C++ 03)只允許list<pair<int,int> >。在最後兩個標記之間應該有一個空格,否則編譯器會將它們解釋爲>>(右移)運算符。

一些較新的編譯器對此語法進行了重新規範化,它是即將出現的C++ 0x標準的一部分,但也許doxygen還不能識別它。

+0

這樣做!謝謝。 – 2011-04-14 07:18:44