Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct s77 {
- char d[77];
- };
- struct s1 {
- char d;
- };
- struct Foo: s77, s1 {
- };
- struct Off {
- static const int v = std::size_t(static_cast<s1*>(static_cast<Foo*>(nullptr)+1)) - std::size_t(static_cast<Foo*>(nullptr)+1);
- };
- struct Entry {
- int offset;
- void (*function)(void *member);
- };
- Entry descriptor[] = {
- { 0, &SomeType1::static_function },
- { 12, &SomeType2::static_function },
- { 20, &SomeType3::static_function }
- };
- void call(void *tuple, const Entry *entries, int n) {
- for (int i=0; i<n; i++) {
- entries[i].function(static_cast<char *>(tuple)+entries[i].offset);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement