Raw market data input comes in as array of unsigned chars. I “reinterpret_cast” it to a pointer-to-TradeMsgStruct before looking up each field inside the struct.
Now I think this is the fastest solution. Zero-cost at runtime.
As an alternative, memcpy is also popular but it requires bitwise copy. It often require allocating a tmp variable.