Resurrection
Resurrection

Reputation: 4106

How to document enum class values out of line in source with Doxygen

I am trying to document an enum class values out of line in the *.cpp file:

Consider:

class SomeClass
{
    enum class MyEnum
    {
        val1
    };
};

and out-of-line Doxygen documentation in the *.cpp file:

/*!
 * \class SomeClass
 * ...
 *\

/*!
 * \enum SomeClass:MyEnum
 * This works fine.
 */

/*!
 * \var SomeClass::MyEnum::val1
 * And this does not...
 */

The third comment section fails with this message:

warning: no matching class member found for SomeClass::MyEnum::val1

I have tried many variations suggested in other similar questions and answers but to no avail. I can either make the enum class a regular enum or put the documentation inline to the header. Any other options?

Upvotes: 2

Views: 456

Answers (1)

gmug
gmug

Reputation: 795

Try following:

class SomeClass
{
    enum class MyEnum
    {
        val1
    };
};

and in the cpp file:

/*!
 * \class SomeClass
 * ...
 */

/*!
 * \enum SomeClass:MyEnum
 * This works fine.
 */

/*!
 * \var SomeClass::val1
 * And this works now, too...
 */

Note that I removed the tag name of the enumeration.

Upvotes: 1

Related Questions