id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc
12438,Wrong additional closing tag in boost::archive::xml_woarchive,anonymous,Robert Ramey,"boost::archive::xml_woarchive writes an additional line
'''</boost_serialization>'''
after the closing tag
''''''
The output of boost::archive::xml_oarchive is correct.
The ouput of xml_woarchive is
{{{
</boost_serialization>
}}}
The source code is
{{{
// Boost: 1.62.0 BETA1
//
// Toolset: Microsoft Visual C++
// Microsoft Visual Studio Professional 2015
// Version 14.0.25425.01 Update 3
// Visual C++ 2015 00325 - 60002 - 24764 - AA687
// Microsoft Visual C++ 2015
// Behavior is in all configurations 32bit/64bit and debug/release
//
// ====================================================================
// Needed for
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
#include
#include
#include
// ====================================================================
class foo
{
public:
foo() {};
template
void serialize(Archive &ar, const unsigned int version) {}
};
// --------------------------------------------------------------------
void save_sfoo(const foo& s_foo, const std::string& filename)
{
std::ofstream ofs(filename);
boost::archive::xml_oarchive oa(ofs);
oa << BOOST_SERIALIZATION_NVP(s_foo);
}
// --------------------------------------------------------------------
void save_wfoo(const foo& w_foo, const std::string& filename)
{
std::wofstream ofs(filename);
boost::archive::xml_woarchive oa(ofs);
oa << BOOST_SERIALIZATION_NVP(w_foo);
}
// ====================================================================
int main(int argc, char *argv[])
{
foo some_foo;
std::string savedir(boost::archive::tmpdir());
std::cout << ""Saving s_foo.xml and w_foo.xml to directory <"" << savedir << "">"" << std::endl;
save_sfoo(some_foo, savedir + ""/sfoo.xml"");
save_wfoo(some_foo, savedir + ""/wfoo.xml"");
return 0;
}
// ====================================================================
// Files created are
// ====================================================================
// ""sfoo.xml""
// --------------------------------------------------------------------
/*
*/
// --------------------------------------------------------------------
// ""wfoo.xml""
// --------------------------------------------------------------------
/*
</boost_serialization>
*/
}}}
",Bugs,closed,To Be Determined,serialization,Boost 1.62.0,Problem,fixed,,juergen.flieser@…