Waldo Spek
Waldo Spek

Reputation: 91

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.

Upvotes: 4

Views: 1054

Answers (1)

Boaz Yaniv
Boaz Yaniv

Reputation: 6424

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.

Upvotes: 3

Related Questions