Boost logo

Boost Users :

Subject: Re: [Boost-users] serilalization of union
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-01-07 11:50:16


This was a surprise to me. Open up a Trak item and also mention which compiler you're using.

In the meantime you'll need to find a way to work around it. I know that serialization
works for boost:variant.

Robert Ramey

  "niranjan bangera" <niranjannina_at_[hidden]> wrote in message news:50a2f6f20901070600ocb96a43ka10ea96c3d0bc02c_at_mail.gmail.com...
  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 mailing list
  Boost-users_at_[hidden]
  http://lists.boost.org/mailman/listinfo.cgi/boost-users



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