The memcpy approach is a workaround for gcc's bug. The speed performance on gcc is the same between both approach. But on clang, the memcpy approach is 10% slower than an assignment approach. Hence I added the switching approach code using compiler checked macro.
Note: __GNUC__ is defined both gcc and clang. So I use __GNUC__ && !__clang__
When doing streaming deserialization, valgrind complains about mismatched free()...
It's caused by calls to auto_ptr::free for zones that are null pointers.
The patch add serialization operator for the given enum to avoid the use
of a cast which leads to strict-aliasing warnings and the test to fail.
Solution suggested by qehgt.