I'm curious about the optimisations that C++ compilers do when it comes to moving data around during run-time. Recently, I've been thinking about how classes are passed through the code as I know that if you pass a bool to a function you don't need to define it as const& but if you have, for example, a std::vector<T> then typically you would use const& as this tends to be larger than 64 bits and thus is more efficient to do so.
Now, if you had a class which consists of two variables, a uint8_t and a int8_t, would the compiler, under the covers, move this class around as it would a single int16_t or uint16_t? Similarly, with a class with two int32_t would it be treated in the same manner when moving around in memory as a single int64_t?