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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With