Class Layout

Speaker: Miloš Anđelković

Audience level: [ Beginner | Intermediate ]

It's a regular thing to write a class that will later be used in various ways trough the application. But how often do we stop and thing about what the compiler does with it, what the compiler can do with it, and finally how the class ends up looking in memory. To novice programmers there are some rules and behaviors that might be surprising. Here we will take a stroll trough the C++ documentation and see what the compiler is allowed, by law, to do, define some terms, see what tools we can use to peek under the hood and better understand our code. All of this of course accompanied with some simple examples because seeing is believing. And finally this entire exercise would be useless unless we see what actual impact this has on performance.

This is intended to be beginner friendly so it will not cover every edge case and things like virtual inheritance and vtable pointers, but even more experienced programmers might find some interesting nuggets of information.