It's worth noting that, as well as member function pointers, the C++ standard also providesmember data pointers.
一些函数将成为成员函数,而一些则不会(参见第23、24、46条)。
Some functions will be member functions, but some will not(see Items 23, 24, and 46).
若member是static成员或成员函数,则行为未定义。
If member is a static member or a member function, the behavior is undefined.
嵌套函数和类成员函数可以被称为闭包(也被称为委托),它们可使范型编程更为容易并保证类型安全。
Nested functions and class member functions can be referenced with closures(also called delegates), making generic programming much easier and type safe.
成员函数指针有一个可怕的限制:它们只能指向一个特定的类中的成员函数。
Member function pointers have a horrible restriction: they can only point to member functions of a single class.
它引入了多重继承、抽象类、静态成员函数、常数成员函数及成员保护等新特性。
And then it went through some major updates like- multiple inheritances, abstract classes,static member functions, constant member functions, and protected member functions..
如果你使用了成员函数指针,你最好使用typedef以防止混淆。
If you're using member function pointers, you should always use a typedef to avoid confusion.
Internal访问说明符允许一个类将其成员变量和成员函数暴露给当前程序中的其他函数和对象。
Internal access specifierallows a class to expose its member variables and member functions to other functions and objects in the current assembly.
When const and non-const member functions have essentially identical implementations, code duplication can be avoided by having the non-const version call the const version.
构造函数是一个特殊的成员函数,名字与类名相同,不写返回值类型。
A constructor is a member function which has the same name of the class without a return type.
When const and non-const member functions have very similar implementations you can avoid code duplication by having the non-cont version call the const version.
任何成员函数必须在struct声明中声明,不能把它放在其他地方。
Any member function must be declared in the struct declaration; you cannot put it elsewhere.
您还可以使用wait_for()或wait_until()成员函数指定等待超时,以避免无限期阻塞。
You can also specify a timeout on the wait using the wait_for()or wait_until() member functions to avoid indefinite blocking.
现在,我想你对成员函数指针的事情已经知道得太多了。
By now, you know far too much about member function pointers.
顺便提一句,注意extern“C”的链接声明对成员函数无效(见C++标准文档的7.5.4章节).
By the way,note that an extern"C" linkage declaration is ignored for member functions(7.5.4 of the C++ standard).
我同时会解释为什么使用成员函数指针的规则具有如此严格的限制。
This will alsohelp to explain why the rules about the use of member function pointers are so restrictive.
中文
Bahasa indonesia
日本語
عربى
Български
বাংলা
Český
Dansk
Deutsch
Ελληνικά
Español
Suomi
Français
עִברִית
हिंदी
Hrvatski
Magyar
Italiano
Қазақ
한국어
മലയാളം
मराठी
Bahasa malay
Nederlands
Norsk
Polski
Português
Română
Русский
Slovenský
Slovenski
Српски
Svenska
தமிழ்
తెలుగు
ไทย
Tagalog
Turkce
Українська
اردو
Tiếng việt