Created
January 29, 2018 10:05
-
-
Save fortheday/bee1e59506115047dc6a2cabb07d9e07 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
#pragma pack(push) | |
#pragma pack(1) | |
struct SRefTest | |
{ | |
char a; | |
char b; | |
char &r; | |
SRefTest() : a(1), b(2), r(a) {} | |
}; | |
#pragma pack(pop) | |
void ReferenceTest() | |
{ | |
std::cout << sizeof(SRefTest) << std::endl; // x86=6 x64=10 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment