简体   繁体   中英

Function type parameter in doxygen

For some reason Doxygen doesn't seem to correctly display the parameter if it has a function type:

/// Brief...
/// 
/// Details...
void x(int f(int, int));

In the list of functions, it shows correctly, but in the detailed entry for x , the parameter f is displayed as:

int fint, int   

instead. Is there a way to work around this problem?

Maybe this is not primarily a Doxygen problem. Your declaration is not so nice as used in the source, I'd prefer a typedef :

namespace MyNamespace
{
/**
 * Type alias \c F for function signature: \code int (*)(int, int) \endcode
 */
typedef int (*F)(int, int);

and the function declaration

/**
 * Function using \em fnPtr with function pointer alias signature 
 * \c MyNamespace::F.
 * @param fnPtr A callback function pointer with alias signature 
 *              \c MyNamespace::F.
 */
void x(F fnPtr);
} // close MyNamespace scope

The generated Doxygen documentation will look proper accordingly IMHO:

生成的文档截图

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