Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to document generated constructors in doxygen

Tags:

c++

doxygen

We use doxygen to document our classes. I would like to explicitly document that a class has generated constructors and/or destructors, to indicate that I've thought about it and decided that e.g. copying using the generated copy constructor is safe. However, the constructor/destructor is not declared and hence doxygen does not know to which function the documentation belongs. Are there ways to make doxygen include function comments even if the function is never declared?

//! The Foo class documentation
class Foo {
    //! @fn Foo(const Foo&) 
    //! Generated copy constructor OK to use

    //! method documentation
    void method();
}

Also I wouldn't want to write the signature of the generated files at all.

I guess my other option is to just describe it in the class header. Are there any other approaches?

like image 231
andreas buykx Avatar asked Nov 14 '22 02:11

andreas buykx


1 Answers

If you use the = default notion introduced in C++0x for your default generated constructors, doxygen should pick them up

http://www2.research.att.com/~bs/C++0xFAQ.html#default

I don't know if doxygen has implemented the C++0x new keywords and patterns yet though

like image 91
David Avatar answered Dec 17 '22 23:12

David