Search code examples
c++doxygennon-member-functions

Documenting functions in C++ with Doxygen


I've got a project that I'm using Doxygen to generate documentation for. The documentation of the classes is fine, but I've also got some non-member functions that I use to create objects etc. I'd also like to have these documented, but no matter what I try, Doxygen will not generate documentation from the comments that I have placed above the functions. Why won't Doxygen generate documentation for functions in the global namespace, and what do I need to do to get this to work?


Solution

  • Use \fn where you otherwise use \class in your \\*! *\ block

    http://www.doxygen.nl/manual/docblocks.html look for "Documentation at other places"

    http://www.doxygen.nl/manual/commands.html#cmdfn
    It works similar as documenting member functions