Boost logo

Boost Users :

Subject: [Boost-users] serilalization of union
From: niranjan bangera (niranjannina_at_[hidden])
Date: 2009-01-07 09:00:14


Hi all,

I am using the boost version 1.36.0 , linux platform.
In my project i have to srialize a Union . i tried in the same way that
classes and structures been serialized. But it gives a compilation error.
How can i do that.. Please help me doing this.

union myunion
{

uint32_t a;
float t;

};

i tried using like this.

union myunion
{

uint32_t a;
float t;

template <class Archive>
void serialize(Archive & ar, const unsigned int file_version)
{

ar & a;
ar & t;

}

i get an error when iwant to serialize the object of the union saying
myunion is not a class or struct type.

Pls help me to do this.

thanks in Advance.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net