cppalliance / mrdocs

MrDocs: A Clang/LLVM tool for building reference documentation from C++ code and javadoc comments.
https://mrdocs.com
Other
67 stars 16 forks source link

inheriting javadocs for aliases #360

Open vinniefalco opened 1 year ago

vinniefalco commented 1 year ago

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;
};
alandefreitas commented 2 weeks ago

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