5

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?

2
  • 3
    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. Commented Feb 23, 2011 at 13:22
  • 4
    nice example of why tools like Doxygen are incapable of producing useful documentation. Just tell the user that the class is copyable. Commented Feb 23, 2011 at 13:30

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

that research link is 404

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.