$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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