Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boost::function f<(void)(MyObject*, int, int)> = &MyObject::method_that_takes_two_ints;
- void (MyObject::*f)( int, int ) = &MyObject::method_that_takes_two_ints;
- void (MyObject::*f)( int, int ) = &MyObject::method_that_takes_two_ints;
- MyObject o; (o.*f)(1, 2);
- int main() {
- typedef void fun() const;
- fun MyObject::*mem_function_ptr =
- &MyObject::const_method_that_takes_two_ints;
- }
- void foo() { cout << "hello"; }
- int main() {
- typedef void fun();
- fun * f = &foo;
- }
- struct A {
- operator int() const { return 0; }
- };
- int main() {
- A a;
- int i = a; // implicit conversion using the conversion function
- }
Add Comment
Please, Sign In to add comment