c++ -//! [0] C++——它是什么?

标签 c++ directive

什么是//! [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 by EXAMPLE_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/

相关文章:

C++线程意外打印同一行多次

c++ - 如何使用 boost::spirit::x3 测试字符串的有效双重内容?

c++ - 如何复制一个类型?

c - 编译器生成的汇编文件中的 "#APP"是什么意思?

swift - @available 重命名需要帮助

javascript - AngularJS 指令不会检测使用 "this"绑定(bind)变量的 Controller 作用域

c++ - 在 C++ 中如何将方法指定为析构函数而不是构造函数?

c++ - 继续获取 "error LNK1104: cannot open file ' boost_thread-vc100-mt-gd-1_41.lib"

swift - #keyPath 而不是直接将键作为字符串传递有什么用?

javascript - AngularJS 值更改在指令中不可见