views:

299

answers:

1

hello.

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

+1  A: 

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?

arturh
He *could* place each usual parameter on a new line as well.
Pieter
yes, I also wanted to place parameters like that.I just find it somewhat easier to read (in source), since parameter is documented right after the declaration
aaa