Created
December 17, 2020 18:06
-
-
Save fredemmott/ef829d6a27f48b310a392e5b8e162cb2 to your computer and use it in GitHub Desktop.
Why you want to run `cl.exe /vmg`
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
| $ cl.exe test.cpp && test.exe | |
| 10 4 | |
| $ g++ test.cpp -o test && ./test | |
| 10 10 | |
| $ cl.exe /vmg test.cpp && test.exe | |
| 10 10 |
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
| #include <cstdio> | |
| class ForwardDeclared; | |
| class Defined { | |
| void foo(); | |
| }; | |
| struct ContainerA { | |
| void (ForwardDeclared::*ptr)(); | |
| }; | |
| struct ContainerB { | |
| void (Defined::*ptr)(); | |
| }; | |
| int main() { | |
| printf("%lx %lx\n", sizeof(ContainerA), sizeof(ContainerB)); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment