mrdocs icon indicating copy to clipboard operation
mrdocs copied to clipboard

inheriting javadocs for aliases

Open vinniefalco opened this issue 2 years ago • 1 comments

Consider:

/** A value
*/
struct T {};

struct C
{
  using type = T;
};

Should type automatically reference the Javadoc for T because it does not have its own doc? Or should this be an option? Or should we require the user write @copydoc:

struct C
{
  /// @copydoc T
  using type = T;
};

What if there is additional commenting?

struct C
{
  /** @copydoc T

      and more
  */
  using type = T;
};

vinniefalco avatar Jul 02 '23 17:07 vinniefalco

If we do what doxygen does, C::type will have no documentation. This seems correct because C::type is semantically different from T in that its documentation usually describes what it means in the context of C. However, it's still not unreasonable to assume @copydoc T there.

What if there is additional commenting?

I think this is an independent question because it might happen in other contexts. But the answer is that the additional comments are appended because @copydoc foo() is roughly equivalent to doing:

  \brief \copybrief foo()
  \details \copydetails foo()

https://www.doxygen.nl/manual/commands.html#cmdcopydoc

alandefreitas avatar Jun 24 '24 18:06 alandefreitas

I think in using type = T the T should be a hyperlink and we can call it a day.

vinniefalco avatar Oct 25 '24 16:10 vinniefalco

@vinniefalco Sounds good. We already link T, so this is complete.

sdkrystian avatar Oct 25 '24 17:10 sdkrystian