所以我发现需要使用类似Boost.Extension的东西来让我的应用程序更加开放新模块。但只要我到first tutorial我发现,它的语法非常不喜欢我习惯:C++宏:如何创建一个覆盖?
// Depending on the compiler and settings,
// it may be necessary to add a specific export
// declaration. The BOOST_EXTENSION_EXPORT_DECL
// adds this if necessary.
void BOOST_EXTENSION_EXPORT_DECL
boost_extension_hello_world(int repetitions) {
for (int i = 0; i < repetitions; ++i) {
std::cout << "Hello World" << std::endl;
}
}
我想有可能写类似的void function
代替void BOOST_EXTENSION_EXPORT_DECL
它看起来更好,因为我有AS3背景,它不会看起来像我可怕的东西。
那么,如何创建一个C++宏的overrite,而不是在它被定义的头文件中,而是在您自己的C++文件中?
#define function BOOST_EXTENSION_EXPORT_DECL
然后你就可以使用它:
LOL @说过人回答的已经回答的问题有,这是完全一样的东西。 – 2011-03-06 20:40:45
@疯狂的埃迪:它的所有关于反馈和解释结束提示和警告假人我。=) – Rella 2011-03-06 21:02:49