boost

Warnings in boost::priority_queue

丶灬走出姿态 提交于 2020-01-15 12:23:29
问题 When I try to build "priority_queue_example.cpp" it get these warnings(and so errors) pointing to "priority_queue_example.h" on the line where my priority_queue is declared. The warnings are, 1> priority_queue_example.cpp 1>c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(102): error C2220: warning treated as error - no 'object' file generated 1>c:\Projects\lib\boost\boost\heap\detail\stable_heap.hpp(102): warning C4100: 'rhs' : unreferenced formal parameter 1> c:\Projects\lib\boost

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

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

我是研究僧i 提交于 2020-01-15 11:03:08
问题 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

Extracting small parts of large library (fx boost)

倖福魔咒の 提交于 2020-01-15 09:06:26
问题 I would like to know if there is an automated way to extract a small portion of a large C++ library. Let's say I only need boost::rational in some project. However entire boost 1.42 takes up 279 MiB! To keep my project "self-contained" (fx for some school work), I would like to be able to include boost::rational along with my own source. (The idea being, that my teacher should not have to install 1000's of libraries in advance in order to compile) I know this violates good practice, as it

Boost binary serialization doesn't work occasionally. The parsed data is corrupted sometimes

佐手、 提交于 2020-01-15 08:23:33
问题 With unknown reason, boost binary serialization doesn't work occasionally. The parsed data is corrupted sometimes. Originally I serialized instances of self-defined class manually, with each instance being a line in a text file. However, the speed was slow.(The text file was dealt in a speed of 2 MB/sec, which can be seen in windows task manager.) Recently I changed to use the boost binary serialization. However, strange things happens. I stored many many instances of class InstanceIdentity,

Issue with boost serialization of IplImage struct

浪子不回头ぞ 提交于 2020-01-15 06:41:19
问题 I'm having trouble getting the boost serialization module to work with OpenCV's IplImage struct. Here is my code for serializing an IplImage (along with some JSON data in a custom struct) template <class Archive> void save(Archive & ar, const unsigned int version) const { // First things first; save the essential variables // These are needed as input to the create function of IplImage ar & frame->width; ar & frame->height; ar & frame->depth; ar & frame->nChannels; ar & frame->widthStep; ar &

boost python on windows crashes at import(“__main__”);

一世执手 提交于 2020-01-15 05:57:48
问题 I am writting a program which uses boost python embedded. My program works no problem on Linux Mint but on Windows its a huge pain. I am using MingW so I tried creating an import lib following instructions from another question on this site. With all that in mind the program compiled and linked, python34 dynamically and boost python statically. My program crashes though and I cant tell for the life of me why, I followed the execution and it stops at: "import(" main ");" // My python

Why does BOOST_FOREACH not work sometimes with C++ strings?

限于喜欢 提交于 2020-01-15 05:41:09
问题 I am using BOOST_FOREACH to iterate through the characters of a C++ string like this: void foobar(const string& str) { BOOST_FOREACH(const char ch, str) { // Do something with ch } return; } This piece of code works fine with the following compilation modes: Multi-threaded (Release) (/MT) Multi-threaded Debug (/MTd) Multi-threaded DLL (Release) (/MD) It causes runtime errors (exceptions) only in this mode: Multi-threaded Debug DLL (Release) (/MDd) There are no compilation errors or warnings

Use of Boost.Log and Boost.ASIO causes a crash

陌路散爱 提交于 2020-01-15 04:38:09
问题 I am running into an issue where the use of Boost.Log in an app causes a crash or a hang when the app loads a shared library that uses Boost.ASIO! Any insights would be appreciated; a full cmake-buildable example is below. If the declaration of the global logger object in main.cpp is uncommented the program will either seg-fault immediately or the resolve() call will do nothing. If left commented out then the program works. I'm using Boost 1.55, g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4