Page 1 of 1

Documenting enum class vs enum

PostPosted: Sun Mar 12 2017 2:59 pm
by usingcpp
Here is the code from the \enum documentation:
Code: Select all
class Test
{
  public:
    enum fruit { pear, orange };

    /*! Another enum, with inline docs */
    enum veggies
    {
      celery,   /*!< docs for value one */
      carrot    /*!< docs for value two */
    };
};

/*! \class Test
 * The class description.
 */

/*! \enum Test::fruit
 * A description of the fruit enum.
 */

/*! \var Test::fruit Test::pear
 * The description of the first fruit.
 */

If I change the enum to an enum class, the documentation still generates correctly. But, what if I add another enum class, say otherFruit, which also has a pear value?
Code: Select all
   enum fruit { pear, orange };

/*! \var Test::otherFruit Test::pear
 * The description of the first otherFruit.
 */

The description for Test::otherFruit::pear is placed in the description for Test::fruit::pear and there is no documentation for Test::otherFruit::pear.

Trying:
Code: Select all
/*! \var Test::otherFruit Test::otherFruit::pear

causes DoxyPress to print:
Warning: documentation found, for a class member which was not found:
Test::otherfruit Test::otherFruit::pear


Is it possible to document enum classes this way?

There is a workaround: document the enum values inline. However, this is not mentioned in the \enum documentation. In fact, documenting enum class does not appear to be mentioned anywhere in the DoxyPress documentation.

Re: Documenting enum class vs enum

PostPosted: Tue Mar 21 2017 7:14 pm
by ansel
Thank you for your report.

You mention trying the following syntax:
Code: Select all
/*! \var Test::otherFruit Test::otherFruit::pear


This syntax makes sense and should be allowed, but is not currently supported. I have filed a ticket to support this case:

http://redmine.copperspice.com/issues/31