Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen fails to parse templated return type

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.

like image 202
Waldo Spek Avatar asked Oct 19 '25 12:10

Waldo Spek


1 Answers

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.

like image 197
Boaz Yaniv Avatar answered Oct 22 '25 03:10

Boaz Yaniv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!