且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

类/线程:(classname ::)(void *)'与`void(*)(void *)'不匹配

更新时间:2023-11-30 23:24:40

如果没有某种不推荐的摆弄方式,你就不能使用成员函数的地址,但是你可以使你的MessageLoop函数保持静态。
You can''t take address of member function without some type of not recommended fiddling,but you can make your MessageLoop function static.


我试过了,我收到以下错误:

18 |错误:在静态成员函数中无效使用成员`console :: Loopflag''

20 |错误:从这个位置|

17 |错误:inva盖子在静态成员函数中使用成员`console :: out''|
21 |错误:从这个位置|

17 |错误:无效使用成员`console :: out''静态成员函数|

22 |错误:从这个位置|

|| ===构建完成:6个错误,0个警告=== |
I tried that, and I get the following error:

18|error: invalid use of member `console::Loopflag'' in static member function|
20|error: from this location|
17|error: invalid use of member `console::out'' in static member function|
21|error: from this location|
17|error: invalid use of member `console::out'' in static member function|
22|error: from this location|
||=== Build finished: 6 errors, 0 warnings ===|



我试过了,我收到以下错误:

18 |错误:在静态成员函数中无效使用成员`console :: Loopflag''|
20 |错误:从这个位置|

17 |错误:无效使用成员`console :: out''在静态成员函数中|

21 |错误:从这个位置|

17 |错误:无效使用成员`console ::在'静态成员函数'中'

22 |错误:从这个位置|

|| ===构建完成:6个错误,0个警告=== |



这样做是因为静态函数没有这个指针。

这个类可以是单身类?

It does that because static functions do not have this pointer.
Can this class be a singleton class?