$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] serilalization of union
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-07 12:09:22
AMDG
niranjan bangera wrote:
> union myunion
> {
>
> uint32_t a;
> float t;
>
> template <class Archive>
> void serialize(Archive & ar, const unsigned int file_version)
> {
>
> ar & a;
> ar & t;
>
> }
This is undefined behavior. a and t cannot both be valid at the same time.
In Christ,
Steven Watanabe