什么是//! [0]
用 C++ 做?我相信这是改变语言默认值的东西,比如关闭惰性求值之类的,但我不太清楚。有数组吗?
最佳答案
当然是评论。对于 doxygen 仍然有特殊意义:
\snippet ( block_id )
Where the
\include
command can be used to include a complete file as source code, this command can be used to quote only a fragment of a source file.For example, the putting the following command in the documentation, references a snippet in file
example.cpp
residing in a subdirectory which should be pointed to byEXAMPLE_PATH
.
\snippet snippets/example.cpp Adding a resource
The text following the file name is the unique identifier for the snippet. This is used to delimit the quoted code in the relevant snippet file as shown in the following example that corresponds to the above \snippet command:
QImage image(64, 64, QImage::Format_RGB32);
image.fill(qRgb(255, 160, 128));
//! [Adding a resource]
document->addResource(QTextDocument::ImageResource,
QUrl("mydata://image.png"), QVariant(image));
//! [Adding a resource]
...
Note that the lines containing the block markers will not be included, so the output will be:
document->addResource(QTextDocument::ImageResource,
QUrl("mydata://image.png"), QVariant(image));
Note also that the
[block_id]
markers should appear exactly twice in the source file.
0
是 block id。
关于c++ -//! [0] C++——它是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16993004/