Is there some way to document template parameters like this:
template<
int N, ///< description
typename T ///< description
>
rather than listing each parameter with tparam
?
please note that function arguments can be documented like this in current doxygen:
void function(int a /**< description */);
if there is not one, how hard would be to implement it? if you are familiar with doxygen internals, can you point me in the direction where to implement it.
thank you
Putting the command @brief will generate a short description of the function when you generate the doxygen documentation. That short description can be extended if you want.
Doxygen is a well-known tool for generating documentation directly out of the annotated source code. However, it can be utilized to create technical documentation, too. In version 1.8. 0, Markdown support was introduced to Doxygen.
Once specified, you can generate the comment stub by typing the respective “///” or “/**” above a function, or by using the (Ctrl+/) shortcut.
There is no way to document your template parameters like you described.
I would say it is not a good idea, because then you would document your template parameters differently from your usual parameters, and why would you want that?
Usually it looks like this:
/*! \p transpose : transpose a matrix
*
* \param A input matrix
* \param At output matrix (transpose of A)
*
* \tparam MatrixType1 matrix
* \tparam MatrixType2 matrix
*/
template <typename MatrixType1, typename MatrixType2>
void transpose(const MatrixType1& A, MatrixType2& At);
and you want it to look like this?!
/*! \p transpose : transpose a matrix
*
* \param A input matrix
* \param At output matrix (transpose of A)
*
*/
template <
typename MatrixType1, ///< matrix
typename MatrixType2 ///< matrix
>
void transpose(const MatrixType1& A, MatrixType2& At);
Why?
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