mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
777b182edd
This allowed me to standardize the sourcetar and sf/* scripts: the base directory (containing ./git) is now empty, except for maintenance scripts, while the source files and build scripts of the annotations are stored in a subdirectory of their own.
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).
|