mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
87ea19cac2
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@435 f6dd340e-d3f9-0310-b409-bdd246841980
24 lines
1.1 KiB
Text
24 lines
1.1 KiB
Text
According to the i(ANSI/ISO) definition, `i(end of line comment)' is
|
|
implemented in the syntax of bf(C++). This comment starts with ti(//) and ends
|
|
at the end-of-line marker. The standard bf(C) comment, delimited by tt(/*) and
|
|
tt(*/) can still be used in bf(C++):
|
|
verb(
|
|
int main()
|
|
{
|
|
// this is end-of-line comment
|
|
// one comment per line
|
|
|
|
/*
|
|
this is standard-C comment, covering
|
|
multiple lines
|
|
*/
|
|
}
|
|
)
|
|
Despite the example, it is advised em(not) to use bf(C) type comment
|
|
inside the body of bf(C++) functions. Sometimes existing code must temporarily
|
|
be suppressed, e.g., for testing purposes. In those cases it's very practical
|
|
to be able to use standard bf(C) comment. If such suppressed code itself
|
|
contains such comment, it would result in nested comment-lines, resulting in
|
|
compiler errors. Therefore, the i(rule of thumb) is not to use bf(C) type
|
|
comment inside the body of bf(C++) functions (alternatively, tt(#if 0) until
|
|
tt(#endif) pair of preprocessor directives could of course also be used).
|