我正在开发一个有多个插件的C++/Qt程序。 对于每个类我必须定义一个插件的界面,它看起来像这样: //my class
class qwerty;
//my interface
class qwertyPlug : public QObject, myPlug {
Q_OBJECT
Q_INTERFACES(nPanPlug)
Q_PLUGIN_METADATA(IID "org.
if constexpr是在C++程序中摆脱预处理器的一大步。但是它只能在功能 - 就像这个例子: enum class OS
{
Linux,
MacOs,
MsWindows,
Unknown
};
#if defined(__APPLE__)
constexpr OS os = OS::MacOs;
#elif defined(__MING
#include <stdio.h>
#define STR /*~~Complete this line~~*/
/* such that the output of the code is
M = 10
N = 5
*/
#define N 5
#define M 10
int main() {
printf(STR(M));
printf("\n");
pri