Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] Question about pointers andcasting
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-10-24 01:20:35


Ahhh - so try

    ar >> static_cast<A* &>(a2p);

Robert Ramey

troy d. straszheim wrote:
> Ben wrote:
>> {
>> std::ifstream ifs(fname);
>> boost::archive::binary_iarchive ar(ifs);
>> ar >> static_cast<A*>(a2p);
>> }
>
> You're trying to write to an rvalue. Note that
>
> int *ip = 0;
> static_cast<int*>(ip) = 0; // lvalue required as
> // left operand of assignment
>
> doesn't compile either...
>
> -t


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