5
votes

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?

1
Do you actually see any reason to document copy constructor? I mean it is obvious what it does, and if you are allowing the use of the generated constructor, then you as author are obviously OK with that. - Šimon Tóth
nice example of why tools like Doxygen are incapable of producing useful documentation. Just tell the user that the class is copyable. - jalf

1 Answers

1
votes

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