Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-03-04 23:51:12


> Why my code doesn't compile

To find out, read the "rationale" section of the documentatio

and what should I do to build it?

//---------------------------------------------------
int main(int argc, char *argv[])
{
    // create a new auto pointer to ta new object of type A
    const std::auto_ptr<A> spa(new A); // note const here!
    // serialize it

    std::ofstream ofs("auto_ptr.txt");
    boost::archive::text_oarchive oa(ofs);
    oa << spa;
    return 0;
}

Robert Ramey


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