How to document C++ non-type template parameters?

Viewed 429

Are there any guidelines on how C++ non-type template parameters should be documented with Doxygen?

For example, how should we comment the non-type template parameter Size in the Test class?

template<int Size>
class Test { };

I tried such declaration:

/// \tparam Size

But it gives the following warning:

"'\tparam' command used in a comment that is not attached to a template declaration [-Wdocumentation]".

1 Answers

I use JavaDoc-style comments in my code. I tested with this:

/**
 * This is my test.
 *
 * @param Size Interesting
 */
template <int Size>
class Test {
};

And it produced this:

Detailed Description

template<int Size>
class Test< Size >

This is my test.

Parameters
Size    Interesting
Related