Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] Please help me solve this compile error.
From: Mark.Bartosik_at_[hidden]
Date: 2014-08-04 10:29:50


Visual C++ has a “Microsoft extension” that allows it to take a non-const reference to a temporary (and boost serialization uses non-const references whether you are serializing in or out).

If you compile with Microsoft extensions enabled: /Ze the following code will compile.
If you compile without Microsoft extensions enabled: /Za the following code will not compile.

struct obj_t{};

void foo( obj_t & );
obj_t bar();

void main()
{
    foo( bar() );
}



From: Boost-users [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Paul Blampspied
Sent: Saturday, August 02, 2014 4:13 PM
To: boost-users
Subject: Re: [Boost-users] [serialization] Please help me solve this compile error.

Thanks very much. That is exactly what the problem was. It used to work at one time though. I think the C++ standard may have changed - or maybe it was in Visual C++ before I switched to a Linux environment.

many thanks.

On Wed, Jul 30, 2014 at 2:48 PM, Bjorn Reese <breese_at_[hidden]<mailto:breese_at_[hidden]>> wrote:
On 07/30/2014 04:01 AM, Paul Blampspied wrote:
     boost::archive::binary_oarchive oa(file);
     oa << PersistentManagedArray<int>(size, capacity, ints); //This line does not compile !

The stream operator in Boost.Serialization does not take temporary
objects, so create the PersistentManagedArray<T> object on a separate
line, and then pass it to the stream.

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]<mailto:Boost-users_at_[hidden]>
http://lists.boost.org/mailman/listinfo.cgi/boost-users



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