Following code produced assert at line 444 in
libs/serializatin/src/basic_iarchive with version 1.32.0, 1.33.0 and with
every archive that's headers are included:
#define BOOST_SERIALIZATION_DYN_LINK
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include <iostream>
#include <sstream>
#include
int main(int argc, char* argv[])
{
std::pair a(11, 22);
std::map b;
b[0] = 0;
b[-1] = -1;
b[1] = 1;
std::stringstream ss;
{
std::pair *pa = &a;
std::map *pb = &b;
boost::archive::binary_oarchive oa(ss);
oa << boost::serialization::make_nvp("B1", pb);
oa << boost::serialization::make_nvp("A1", pa);
}
std::cout << ss.str();
{
std::pair *pa = 0;
std::map *pb = 0;
boost::archive::binary_iarchive ia(ss);
ia >> boost::serialization::make_nvp("B1", pb);
ia >> boost::serialization::make_nvp("A1", pa);
delete pa;
delete pb;
}
return 0;
}
Similar program without nvp's has the same problem:
int main(int argc, char* argv[])
{
std::pair a(11, 22);
std::map b;
b[0] = 0;
b[-1] = -1;
b[1] = 1;
std::stringstream ss;
{
std::pair * const pa = &a;
std::map * const pb = &b;
boost::archive::text_oarchive oa(ss);
oa << pb;
oa << pa;
}
std::cout << ss.str();
{
std::pair *pa = 0;
std::map *pb = 0;
boost::archive::text_iarchive ia(ss);
ia >> pb;
ia >> pa;
delete pa;
delete pb;
}
return 0;
}