Last active
August 29, 2015 14:04
-
-
Save nicolas17/c4b3b692ad69f5d9a9c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Quux; | |
class Foo { | |
public: | |
void (Quux::*ptr)(); | |
}; | |
int main() { | |
Foo x; | |
printf("The pointer to member function is %d bytes\n", sizeof(x.ptr)); | |
} | |
//output: The pointer to member function is 16 bytes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Quux {}; | |
class Foo { | |
public: | |
void (Quux::*ptr)(); | |
}; | |
int main() { | |
Foo x; | |
printf("The pointer to member function is %d bytes\n", sizeof(x.ptr)); | |
} | |
//output: The pointer to member function is 4 bytes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Quux; | |
class Foo { | |
public: | |
void (Quux::*ptr)(); | |
}; | |
class Quux{}; | |
int main() { | |
Foo x; | |
printf("The pointer to member function is %d bytes\n", sizeof(x.ptr)); | |
} | |
//output: The pointer to member function is 16 bytes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment