Doxygen 1.8.13 忽略具有默认值的参数 (C++)

Doxygen 1.8.13 ignores parameters with default values (C++)

我们目前正在使我们的评论与 Doxygen 兼容,但偶然发现了默认参数的问题。

一个例子是这个函数:

...
class String : public Object
{
     ...
    /*! 
    * \brief Trim the string from the left while the characters matches any characters in the given string
    * \param In_pChar - (optional) The array of characters to be trimmed
    * \return The trimmed string object
    */
    String& trim_left(const char * In_pChar=" \t");
    ...
};
...

Doxygen 完全省略了参数,甚至发出警告:

warning: argument 'In_pChar' of command @param is not found in the argument list of String::trim_left()

结果 HTML 并不是我预期的那样:

有人知道如何解决这个问题吗?

您的问题几乎可以肯定是您的 ... 之一,或者您的 doxygen 版本有问题。

以下代码对我来说工作正常:

class String : public Object                                                                            
{                                                                                     
public:                                                                                                 

/*!                                                                                                     
 * \brief Trim the string from the left while the characters matches any characters in the given string 
 * \param In_pChar - (optional) The array of characters to be trimmed                                   
 * \return The trimmed string object                                                                    
 */                                                                                                     
    String& trim_left(const char * In_pChar=" \t");                                                     

};