Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7474: compilation error in boost::serialization
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-22 21:00:09
#7474: compilation error in boost::serialization
--------------------------------------------+-------------------------------
Reporter: Like Gao <gao.like@â¦> | Owner: ramey
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: serialization
Version: Boost Release Branch | Severity: Problem
Resolution: invalid | Keywords:
--------------------------------------------+-------------------------------
Changes (by ramey):
* status: reopened => closed
* resolution: => invalid
Comment:
{{{
int main() {
const MyClassA clsA(12); // error - should be "const"
std::ofstream f("/tmp/boost_clsA", std::ios::binary);
if (f.fail()) return -1;
boost::archive::text_oarchive oa(f);
oa << clsA;
f.close();
return 0;
}
}}}
Exactly as I expected. For this to compile you have to have the "const".
The reason for this is explained in the Rationale section in the
documentation. Please read it.
Robert Ramey
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7474#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC