Useful undocumented Visual Studio compiler switches

Updated 1st February 2024 to fix broken links

There are a couple of undocumented Visual Studio compiler switches which can be useful occasionally:

  • /d1reportSingleClassLayout<name> - which produces a dump of the in memory layout of a given class

  • /d1reportAllClassLayout - which does the same for ALL classes

See here and here for more details.

And if you liked that, you might find this collection of debugging tricks interesting.