On Wed, Dec 9, 2015 at 7:18 AM, Martin Vymazal
What would be a possible approach to save the data without 'relying on the platform specific bit representation of primitive data types' as you put it?
What about using boost integer to find an unsigned integer (let's call its type Lint) longer or equal than the float (type Float) you have and make an union? union Lint_Float_t { Lint store; Float read; }; static_assert(sizeof(Lint) >= sizeof(Float), ""); To store you copy the float in the union, and save the integer. To load you load the integer and copy from the union the float. It is definitely not portable (reading and writing different types in a union is at most implementation dependant) and you keep the original bits, but it should work at least on machine of the same type. Cheers, Paolo