Boost logo

Boost Users :

From: Sean Kelly (sean.kelly_at_[hidden])
Date: 2005-05-12 11:20:57

Dear All,

I'm trying to figure out if something like the below is possible with
the serialization library. The
idea is to serialize a heterogeneous sequence using shared_pointer<void>.

thanks for any help


     // create and open a character archive for output
    std::ofstream ofs("dictionary.pickle");
    boost::archive::text_oarchive oa(ofs);

    std::deque<boost::shared_ptr<void> > sequence;
    sequence.push_back(boost::shared_ptr<string>(new string("random
    sequence.push_back(boost::shared_ptr<double>(new double(3.1415627)));
    sequence.push_back(boost::shared_ptr<bool>(new bool(false)));
    // write class instance to archive
    oa << sequence;
    // close archive

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at