C + + annotations
There are only two types of comments in C + +:
- Single-line comment, beginning with "//";
- The paragraph comment begins with "/*" and ends with "*/".
int // value is an integer variable, which is a single-line comment /* test is a class for testing this is a line in a comment this is another line in a comment */class Test {};
Doxygen Note: Keep in mind that the following 3 grammar rules are enough
Doxygen comments can be categorized as follows, as described above in the C + + comments:
- Front-line comment, starting with "//";
- A post-line comment, beginning with "///<", immediately following the code;
- The paragraph comment begins with "/**" and ends with "*/".
Doxygen comments are not just for people to see, when generating a document, the program needs to identify the relative position of the annotation and code according to the agreed syntax, so the Doxygen's single-line comment can be divided into two predecessors:
/// value0 is an integer variable, and the comment precedes the code int Value0; int /// < value1 is an integer variable, and the comment is behind the code
Paragraph comments can also be divided into pre-and post-two, but the post-paragraph comment is not very meaningful, I oppose the students write the post-paragraph comment:
/* *test is a test class this is a line in a comment statement this is another line in a comment statement */ class Test {};
Examples\afterdoc.h
Doxygen installation folder under the Examples\afterdoc.h, the contents are as follows:
/*! A Test Class*/classtest{ Public: /** An enum type. * The documentation block cannot is put after the enum! */ enumEnumtype {intEVal1,/**< enum value 1*/ intEVal2/**< Enum value 2*/ }; voidMember ();//!< a member function. protected: intValue/*!< an integer value*/};
Using the above 3 grammar rules to readjust, is not circumnavigated enlightened?
/** A Test class*/classtest{ Public: /** An enum type. The documentation block cannot is put after the enum! */ enumEnumtype {intEVal1,///< enum value 1int EVal2///< enum value 2 }; voidMember ();///< a member function. protected: intValue///< an integer value};
Series Article index: http://www.cnblogs.com/duxiuxing/p/4301031.html
C + + comments and Doxygen comments