Doxygen - declare a parameter as optional

I am documenting the code base with Doxygen and wondering if there is a keyword for declaring an argument to a function that will be optional. Sort of:

/*! \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 that this is what should exist, but I could not find it anywhere. Is there a real option, or do I just need to make a note in the description?

+6
source share
2 answers

To answer your question: No, this does not happen.

But I do not share your opinion that there should be something like that. In the end, the function declaration will be displayed along with its documentation, so that everyone can see that b is optional, and that this is the default argument. For \fn see the doxygen documentation that prevents the use of \ fn .

+8
source

What you want is not provided by Doxygen - you will have to manually write it in the description.

0
source

All Articles