tags:

views:

517

answers:

2

I have some C++ source code with templates maybe like this - doxygen runs without errors but none of the documentation is added to the output, what is going on?

///
/// A class
///
class A
{
  ///
  /// A typedef
  ///
  typedef B<C<D>> SomeTypedefOfTemplates;
};
+4  A: 

Yeah, so what is going on is the template instantiation is bogus. The ">>" like that is ambiguous and is meant to be a compile time error. You couldn't see it because maybe your compiler (VC++) let it slip by but I guess doxygen was stricter on that. Add a space like shown.

///
/// A class
///
class A
{
  ///
  /// A typedef
  ///
  typedef B<C<D> > SomeTypedefOfTemplates;
};
1800 INFORMATION
Yep, the >> gets interpreted as a right-shift operator. C++0x will change this behavior, though. See http://en.wikipedia.org/wiki/C%2B%2B0x#Angle_bracket
Adam Rosenfield
Did you just ask your own question and answer it for the sake of it?
mdec
You got a problem with that?
1800 INFORMATION
+1  A: 

Note that doxygen now supports closing a template with the right shift operator (since version 1.6.0).

Also see http://bugzilla.gnome.org/show%5Fbug.cgi?id=560512 for a discussion on the problem and the solution implemented.

Dimitri van Heesch