Created
May 2, 2015 19:58
-
-
Save agrippa1994/e040886ace460368726b 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
#define GET_OFFSET_FROM_INITIALIZED_STRUCT(PTR, MEMBER) [&]() -> unsigned int { return (unsigned int)&PTR.MEMBER - (unsigned int)&PTR; }() | |
#define GET_OFFSET_FROM_NON_INITIALIZED_STRUCT(STRUCT, MEMBER) []() -> unsigned int { STRUCT s; return GET_OFFSET_FROM_INITIALIZED_STRUCT(s, MEMBER); }() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment