Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen - declare parameter as optional

I am documenting a codebase using Doxygen and was wondering if there is a keyword for declaring an argument to a function to be optional. Something like:

/*!
\fn int add(int a, int b=0)
\brief adds two values
\param a the first operand
\param \optional b the second operand.  Default is 0
\return the result
*/

It seems like this is something that should exist, but I haven't been able to find it anywhere. Is there an actual option, or do I just need to make note in the description?

like image 218
ewok Avatar asked Jan 10 '13 15:01

ewok


1 Answers

To answer your question: No, there is no such thing.

But I don't share your opinion that there should be something like that. After all, the function declaration will be displayed together with its documentation, so everybody can see that b is optional and what it's default argument is. And for the \fn see doxygen's documentation discouraging the use of \fn.

like image 101
Arne Mertz Avatar answered Sep 20 '22 13:09

Arne Mertz