'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?



Solution 1:[1]

What you want is not provided by Doxygen - you will have to manually make a note of it in the description.

Solution 2:[2]

I cheat and use \param foo [in,out,opt,banana] Describe what foo is for.

You can add any options!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mike Kwan
Solution 2 wovano