I am aware that word-aligned members are faster to access than non-word-aligned members. If I was creating an object which was ubiquitous in a real-time system, I might be concerned with the alignment, favouring access-speed over memory-consumption.
On the other hand, if I was programming for an embedded system where memory is limited, I might favour memory-consumption over access-speed.
Knowing the ins out outs of memory alignment helps me make these decisions.
Absolutely. Because the alignment implemented by a given compiler vendor for a given platform may or may not agree with other platforms/compilers. In other words, trying to use this information to your advantage will hurt portability and I suspect maintenance will also become troublesome.
If there is no hard evidence that these things need to be considered, the best bet is to embrace the abstractions that the language supports.
If the intention is to serialize data, consider serializing it more flexibly. Boost.Serialization, for example, can serialize classes portability (in XML by default, I think).
There are vendor-specific constructors to "pack" structures but I don't recommend them. This is the kind of "cleverness" that many modern C++ texts discourage.
Fair enough, but in the event that I am developing bespoke software for in-house use, and I know the compiler and architecture I'm developing for, I could pose these questions during my design?
Let's say I was designing an in-house market-data system for an investment bank. Millions of prices are received, so I want my structure which represents a price to be fast to access.
How can I use knowledge of how members are aligned to my advantage to optimise my price structure for a given architecture?
Every C compiler I've seen provides a #prama to control alignment. If you need to guarantee alignment, you should use that mechanism. You cannot determine what an implementation may choose as it's default for a given memory model.