且构网

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

如果函数指针不需要和号,为什么boost :: bind需要一个?

更新时间:2021-09-09 09:54:42

函数指针不需要它,成员函数指针。

Function pointers don't need it, member function pointers do.

Device :: asyncUpdate 是成员函数,因为你可以猜到,因为它被绑定到

Device::asyncUpdate is member function, as you could guess because it is being bound to this.

这是从n3337,5.3.1 / 4的规范性引文

Here's a normative quote from n3337, 5.3.1/4


指向成员的指针只有在显式&并且其操作数是未括在括号中的合法ID。

A pointer to member is only formed when an explicit & is used and its operand is a qualified-id not enclosed in parentheses.