开发者

doxygen C++ inline template documentation

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 th开发者_开发知识库ere 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


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜