c++ - wxWidgets 中的奇怪注释
c++ - Weird Comment In wxWidgets
我在代码块中生成的wxWidgets代码中发现了一个奇怪的注释符号模式,并且其中的某些部分也被编译器执行。
这个符号到底是什么,它的作用和名称是什么?
//(* ... //*)
以下是如何在应用程序源代码中实现的示例:
//(*AppInitialize
bool wxsOK = true;
wxInitAllImageHandlers();
if ( wxsOK )
{
teesrtFrame* Frame = new teesrtFrame(0);
Frame->Show();
SetTopWindow(Frame);
}
//*)
单词AppInitialize
似乎被忽略了,但是所有有效代码都被编译了。
编辑:
希望这张图能解释我的疑惑。
//(*AppInitialize -- > Inline comments start with //
bool wxsOK = true;
wxInitAllImageHandlers();
if ( wxsOK )
{
teesrtFrame* Frame = new teesrtFrame(0);
Frame->Show();
SetTopWindow(Frame);
}
//*) --> inline comment start with //
它们是内联评论。
如果任何内容以 //
开头,则保留该行的其余部分。这是一个评论。 (*
和*)
没有任何关系。
真的没什么。 //
开始注释,一直持续到行尾 - //
之后行中的所有内容都被编译器忽略。
那是 wxSmith 代码。从它的 docs:
This is a block of code that is automatically generated by wxSmith.
Every block starts with a //(BlockName comment and ends with a //).
You may find other similar blocks in both header and source files. If
you change their content, all changes will be lost next time you
change something in the editor. These comments and everything inside
them belong to wxSmith, so don't mess with them.
我在代码块中生成的wxWidgets代码中发现了一个奇怪的注释符号模式,并且其中的某些部分也被编译器执行。
这个符号到底是什么,它的作用和名称是什么?
//(* ... //*)
以下是如何在应用程序源代码中实现的示例:
//(*AppInitialize
bool wxsOK = true;
wxInitAllImageHandlers();
if ( wxsOK )
{
teesrtFrame* Frame = new teesrtFrame(0);
Frame->Show();
SetTopWindow(Frame);
}
//*)
单词AppInitialize
似乎被忽略了,但是所有有效代码都被编译了。
编辑:
希望这张图能解释我的疑惑。
//(*AppInitialize -- > Inline comments start with //
bool wxsOK = true;
wxInitAllImageHandlers();
if ( wxsOK )
{
teesrtFrame* Frame = new teesrtFrame(0);
Frame->Show();
SetTopWindow(Frame);
}
//*) --> inline comment start with //
它们是内联评论。
如果任何内容以 //
开头,则保留该行的其余部分。这是一个评论。 (*
和*)
没有任何关系。
真的没什么。 //
开始注释,一直持续到行尾 - //
之后行中的所有内容都被编译器忽略。
那是 wxSmith 代码。从它的 docs:
This is a block of code that is automatically generated by wxSmith. Every block starts with a //(BlockName comment and ends with a //). You may find other similar blocks in both header and source files. If you change their content, all changes will be lost next time you change something in the editor. These comments and everything inside them belong to wxSmith, so don't mess with them.