$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [serialization - newbie] serializing/deserializing singleton class objects
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2009-08-12 10:46:26
Soumen wrote:
[snip]
>
> D::cleanup();
> D *dObj = D::instance();
> iparchive >> (*dObj);
>
[snip]
I am also trying to do serialization of singletons (see post regarding
serialization and error category). Have you considered using the stuff
available for "non-default constructors" (see doc) for loading? E.g.,
template<class Archive>
inline void load_construct_data( Archive & ar, D * dObj, const unsigned int
file_version ){
dObj = D::instance();
}
Cheers,
Rutger