Skip to content

Instantly share code, notes, and snippets.

@den-mentiei
Created December 11, 2013 11:54
Show Gist options
  • Save den-mentiei/7909117 to your computer and use it in GitHub Desktop.
Save den-mentiei/7909117 to your computer and use it in GitHub Desktop.
C++ pointer-to-member
#include <iostream>
struct A {};
struct B : virtual A {};
struct C {};
struct D : A, C {};
struct E;
int main() {
std::cout << sizeof(void (A::*)()) << std::endl;
std::cout << sizeof(void (B::*)()) << std::endl;
std::cout << sizeof(void (D::*)()) << std::endl;
std::cout << sizeof(void (E::*)()) << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment