当我编译文件时,我收到此警告:
In file included from AsyncSQL.cpp:8:0:
AsyncSQL.h: In constructor 'CAsyncSQL::CAsyncSQL()':
AsyncSQL.h:192:10: warning: 'CAsyncSQL::m_iCopiedQuery' will be initialized after [-Wreorder]
int m_iCopiedQuery;
^
这是我的AsyngSQL.H http://pastebin.com/u72kyuq7 那么我做错了什么?
答案 0 :(得分:41)
问题是您在第22行初始化列表中初始化成员的顺序
_SQLResult(): pSQLResult(NULL), uiNumRows(0),
uiAffectedRows(0), uiInsertID(0)
这些应该与它们在类定义中出现的顺序相同。例如:
class test {
test(): foo(1), bar(2) { }
int foo;
long bar;
};