boost-serialization

Deserialization of non-finite floating-point numbers fails even with appropriate facets

余生颓废 提交于 2020-01-23 14:08:23
问题 I need to use Boost.Serialization to serialize floating-point numbers. Since NaN and infinites cannot natively be read from an input stream, I am trying to use the facets in boost/math/special_functions. I have tested them on my platform using code similar to the examples we can find here: http://www.boost.org/doc/libs/1_50_0/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/intro.html However, the following code still fails to properly unserialize non-finite floating point values

c++11 std::shared_ptr + boost::serialization [duplicate]

≯℡__Kan透↙ 提交于 2020-01-22 11:19:51
问题 This question already has answers here : How can boost::serialization be used with std::shared_ptr from C++11? (7 answers) boost serialize and std::shared_ptr (2 answers) Closed 6 years ago . Hi has anybody already managed to serialize a C++11 std::shared_ptr with boost::serialization. There are lots of obsolete posts out there but none with an acceptable solution. I am not going into discussion why I want to use the std::shared_ptr just accept it! I found this other post: boost serialize and

c++11 std::shared_ptr + boost::serialization [duplicate]

六月ゝ 毕业季﹏ 提交于 2020-01-22 11:17:12
问题 This question already has answers here : How can boost::serialization be used with std::shared_ptr from C++11? (7 answers) boost serialize and std::shared_ptr (2 answers) Closed 6 years ago . Hi has anybody already managed to serialize a C++11 std::shared_ptr with boost::serialization. There are lots of obsolete posts out there but none with an acceptable solution. I am not going into discussion why I want to use the std::shared_ptr just accept it! I found this other post: boost serialize and

Boost serialization : forward compatibility fail with input stream error

放肆的年华 提交于 2020-01-21 19:29:49
问题 Following this question : Boost serialize child class I'm trying to support forward compatibility for my archive generated with boost serialization but i'm having trouble reading a newer archive with older code : class A { public: A() {} virtual ~A() = default; private: friend class boost::serialization::access; template <class Archive> void serialize(Archive &ar, const unsigned int version) { ar &mAttributeFromA; } std::string mAttributeFromA = "mAttributeFromA"; }; BOOST_CLASS_VERSION(A, 0)

Deserializing STL container of type with no default constructor

落爺英雄遲暮 提交于 2020-01-17 05:13:25
问题 I've recently learned the pattern of the deserializing constructor (Deserializing constructor doesn't read data correctly) to use serialization with types that do not have default constructors. Now I'm trying to serialize an STL container of these objects, as in the example below: #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/serialization/split_member.hpp> #include <boost/serialization/vector.hpp> #include <fstream> class Point { public

Deserializing STL container of type with no default constructor

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-17 05:13:05
问题 I've recently learned the pattern of the deserializing constructor (Deserializing constructor doesn't read data correctly) to use serialization with types that do not have default constructors. Now I'm trying to serialize an STL container of these objects, as in the example below: #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/serialization/split_member.hpp> #include <boost/serialization/vector.hpp> #include <fstream> class Point { public

boost::archive::binary_iarchive invalid signature

吃可爱长大的小学妹 提交于 2020-01-15 18:58:53
问题 when i use boost::archive::binary_iarchive , the error occur :invalid signature when i want to compile the program--cvpr_2012_ffd.you can get it from http://blog.gimiatlicho.webfactional.com/?page_id=38. I compile the program according to it's README. when I run this program that I encounter some error.the error is this l00138375@l00138375:/home/hm/downloads/cvpr_2012_public$ ./FaceForest 1 data/config_ffd.txt data/config_headpose.txt data/haarcascade_frontalface_alt.xml Image pathdata/index

boost::archive::binary_iarchive invalid signature

末鹿安然 提交于 2020-01-15 18:58:25
问题 when i use boost::archive::binary_iarchive , the error occur :invalid signature when i want to compile the program--cvpr_2012_ffd.you can get it from http://blog.gimiatlicho.webfactional.com/?page_id=38. I compile the program according to it's README. when I run this program that I encounter some error.the error is this l00138375@l00138375:/home/hm/downloads/cvpr_2012_public$ ./FaceForest 1 data/config_ffd.txt data/config_headpose.txt data/haarcascade_frontalface_alt.xml Image pathdata/index

how to use boost::serialize::make_binary_object against a map

别来无恙 提交于 2020-01-15 11:07:57
问题 my intention is to get input from map<int,std::string> and create the binary archive which the below code is failing to do , is this the right way of creating it? And how to know whether the data is correctly archived or not(desirializing using boost) Do i just need to create a boost::archive::binary_iarchive oa(oss,1); and copy it to oss ? #include <fstream> #include <boost/serialization/map.hpp> #include <boost/serialization/nvp.hpp> #include <boost/archive/xml_oarchive.hpp> #include

how to use boost::serialize::make_binary_object against a map

被刻印的时光 ゝ 提交于 2020-01-15 11:04:47
问题 my intention is to get input from map<int,std::string> and create the binary archive which the below code is failing to do , is this the right way of creating it? And how to know whether the data is correctly archived or not(desirializing using boost) Do i just need to create a boost::archive::binary_iarchive oa(oss,1); and copy it to oss ? #include <fstream> #include <boost/serialization/map.hpp> #include <boost/serialization/nvp.hpp> #include <boost/archive/xml_oarchive.hpp> #include