How to document friend injection functions with doxygen?

Given some code, as in the following example:

class MyClass;

class Injector {
    /**
     * @brief MyClass addition.
     */
    friend MyClass operator+(MyClass a, MyClass b) { ... }
};

class MyClass: private Injector {};

How to get doxygen to include documentation operator+()on the MyClass class documentation page? Functionally, this clearly belongs. Is there any general way to make an oxygen document function available through ADL?

A useful example in the real world: I would like doxygen to include the operators provided by the base classes in boost/operators.hpp.

+4
source share
1 answer

The tag /relateswas designed for something close to it.

class MyClass;

class Injector {
    /**
     * @brief MyClass addition.
     * @relates MyClass
     */
    friend MyClass operator+(MyClass a, MyClass b) { ... }
};

class MyClass {};

, , .

http://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdrelates

+2

Source: https://habr.com/ru/post/1544812/


All Articles