boost

Boost serialization doesn't work with shared_ptr<int>

拜拜、爱过 提交于 2020-07-03 07:18:04
问题 The following piece of code compiles just fine: #include <boost/serialization/shared_ptr.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_oarchive.hpp> #include <sstream> #include <memory> struct A { int i; A(): i(0) {} A(int i): i(i) {} template <typename Archive> void serialize(Archive& ar, const unsigned int) { ar & i; } }; int main() { auto a = std::make_shared<A>(465); std::stringstream stream; boost::archive::text_oarchive out{stream}; out << a; } Now I would

error: no > match for call to ‘(boost::_mfi::mf1<void

最后都变了- 提交于 2020-06-29 03:56:06
问题 I have rather a basic knowledge in c++ and there is an issue described in the following which is likely rather simple and a based on a syntax mistake but I haven't figured out a way around it. Basically the error I get says: remote_hw_interface_node.cpp:23:68: required from here /usr/include/boost/function/function_template.hpp:231:11: error: no match for call to ‘(boost::_mfi::mf1<void, ROBOTHardwareInterface, const boost::shared_ptr<sensor_msgs::JointState_<std::allocator<void> > > >&>)

unicode regular expressions c++

帅比萌擦擦* 提交于 2020-06-28 09:36:41
问题 I want to match the word "février" or any other month by using regular expression. Regular expression: ^(JANVIER|FEVRIER|MARS|AVRIL|MAI|JUIN|JUILLET|AOUT|SEPTEMBRE|OCTOBRE|NOVEMBRE|DECEMBRE|Jan|Feb|Mar|Apr|May|Jun|JUN|Jul|Aug|Sep|Oct|Nov|Dec|[jJ]anvier|[Ff]évrier|[mM]ars|[aA]vril|[mM]ai|[jJ]uin|[jJ]uillet|[aA]o[éû]t|aout|[sS]eptembre|[oO]ctobre|[nN]ovembre|[dD][eé]cembre)$ Problem The problem is that I cannot match the words that contain unicode letters: à,é,è etc. I found on the following

unicode regular expressions c++

梦想与她 提交于 2020-06-28 09:31:19
问题 I want to match the word "février" or any other month by using regular expression. Regular expression: ^(JANVIER|FEVRIER|MARS|AVRIL|MAI|JUIN|JUILLET|AOUT|SEPTEMBRE|OCTOBRE|NOVEMBRE|DECEMBRE|Jan|Feb|Mar|Apr|May|Jun|JUN|Jul|Aug|Sep|Oct|Nov|Dec|[jJ]anvier|[Ff]évrier|[mM]ars|[aA]vril|[mM]ai|[jJ]uin|[jJ]uillet|[aA]o[éû]t|aout|[sS]eptembre|[oO]ctobre|[nN]ovembre|[dD][eé]cembre)$ Problem The problem is that I cannot match the words that contain unicode letters: à,é,è etc. I found on the following

unicode regular expressions c++

回眸只為那壹抹淺笑 提交于 2020-06-28 09:31:06
问题 I want to match the word "février" or any other month by using regular expression. Regular expression: ^(JANVIER|FEVRIER|MARS|AVRIL|MAI|JUIN|JUILLET|AOUT|SEPTEMBRE|OCTOBRE|NOVEMBRE|DECEMBRE|Jan|Feb|Mar|Apr|May|Jun|JUN|Jul|Aug|Sep|Oct|Nov|Dec|[jJ]anvier|[Ff]évrier|[mM]ars|[aA]vril|[mM]ai|[jJ]uin|[jJ]uillet|[aA]o[éû]t|aout|[sS]eptembre|[oO]ctobre|[nN]ovembre|[dD][eé]cembre)$ Problem The problem is that I cannot match the words that contain unicode letters: à,é,è etc. I found on the following

Reading a serialized struct at the receiver end boost asio

老子叫甜甜 提交于 2020-06-28 03:42:23
问题 I am new to boost and networking ;). I am making a client server application with boost::asio, I need to pass structs as messages so used boost::asio::serialization for it : test.h #pragma once #include <boost/archive/binary_oarchive.hpp> #include <boost/serialization/serialization.hpp> struct Test { public: int a; int b; template<typename archive> void serialize(archive& ar, const unsigned version) { ar & a; ar & b; } }; client side sending: void send_asynchronously(tcp::socket& socket) {

Close the stdin of boost::process child

六月ゝ 毕业季﹏ 提交于 2020-06-27 23:22:48
问题 I'm trying to call a process with a string to its stdin, with Boost-1.64.0. The current code is : bp::opstream inStream ; bp::ipstream outStream; bp::ipstream errStream; bp::child child( command, // the command line bp::shell, bp::std_out > outStream, bp::std_err > errStream, bp::std_in < inStream); // read the outStream/errStream in threads child.wait(); The problem is that the child executable is waiting for its stdin EOF. Here child.wait() is hanging indefinitely… I tried to used asio:

Close the stdin of boost::process child

怎甘沉沦 提交于 2020-06-27 23:22:30
问题 I'm trying to call a process with a string to its stdin, with Boost-1.64.0. The current code is : bp::opstream inStream ; bp::ipstream outStream; bp::ipstream errStream; bp::child child( command, // the command line bp::shell, bp::std_out > outStream, bp::std_err > errStream, bp::std_in < inStream); // read the outStream/errStream in threads child.wait(); The problem is that the child executable is waiting for its stdin EOF. Here child.wait() is hanging indefinitely… I tried to used asio:

vscode cannot find header when compile while Intellisense can

橙三吉。 提交于 2020-06-23 13:36:06
问题 Question Updated: I'm trying to build a c++ project on vscode using the C/C++ extension. The compiler complains about not finding header files (actually boost headers). I have included path to the root folder of boost, and Intellisense is also able to parse the header paths, but not the compiler. I checked the included header in my source is in the corresponding path in my filesystem. Is there any solution to make the compiler see the include headers? This is my c_cpp_properties.json file: {

Not able to archive all the data

筅森魡賤 提交于 2020-06-23 12:37:05
问题 I am using boost for serialization of data. This is how the classes are structured. 1) I have a Stage class This class holds vector data for the director class class Stage { public: std::vector<Director> directors; void AddDirector(Director dir) { directors.push_back(dir); } int GetDirectorSize() { return directors.size(); } Director* GetDirector(int number) { return &directors[number]; } private: friend class boost::serialization::access; template<typename Archive> void save(Archive& ar,