简体   繁体   中英

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

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]".

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM