boost

boost asio acceptor.accept invalid argument

微笑、不失礼 提交于 2020-01-16 18:01:19
问题 i am trying to code with boost asio in socket programming. after setting boost in my ubuntu eclipse environment, i tried the sample code in boost web site. but an error occur on acceptor.accept() function with invalid argument, like below how can i fix this error ? Invalid arguments ' Candidates are: void accept(boost::asio::basic_socket<#10000,#10001> &, std::enable_if<&0[std::is_convertible<boost::asio::ip::tcp,#10000>::value],void>::type *) boost::system::error_code accept(boost::asio:

C++ Boost binary serialization of std::map containing pointers constructed from Boost object_pool

廉价感情. 提交于 2020-01-16 16:58:49
问题 My application has a class "MyClass". It's objects are being constructed from the Boost Object_pool. I need to serialized/de serialize a std::map containing these objects as value via Boost Binary Serialization. For Serialization - I take a pointer from the pool, do some operations, insert it in the std::map and serialize it via Boost binary serialization. For De-serialization - I fetch that serialized buffer and de-serialize it with Boost binary serialization. De-serialization happens

Boost asio - async reading established number of chars from stdin

吃可爱长大的小学妹 提交于 2020-01-16 07:15:28
问题 I wanna write boost::asio app which is reading from stdin with boost::asio::streambuf. Anyway the only function which works on streambuf made from STDIN_FILENO is boost::asio::async_read_until. The other ones throws errors. Is there any possibility to read 100 first character from stdin with boost asio function? 回答1: In principle this just works #include <boost/asio.hpp> #include <boost/asio/posix/stream_descriptor.hpp> using namespace boost::asio; using boost::system::error_code; #include

Why does bjam seem to ignore my arguments?

做~自己de王妃 提交于 2020-01-16 05:10:06
问题 I'm trying to build boost.lib with bjam, but no matter what I do, I can't get it to recognise my BOOST_LOG_NO_COMPILER_TLS flag. I'm building like this: bjam address-model=32 --toolset=msvc-10.0 --build-type=complete --with-log variant=debug link=static runtime-link=static define=BOOST_LOG_NO_COMPILER_TLS stage To verify that it's ignoring the flag, I compiled with and without this flag and used Beyond Compare to compare each file generated in the stage folder. All of the lib files were

Combination of Boost ICL and Boost Serialization

雨燕双飞 提交于 2020-01-16 04:13:29
问题 I'm trying to use the Boost Serialization library to archive Boost ICL interval sets (because I couldn't find any other more or less standard ways to serialize them). I want to split the serialize function into two functions save and load . Sorry to say, I'm stuck in the load function for now - I can't save even the size of the interval set. My testing program is below. The compiler complains about the line A << IS.iterative_size() , which is strange cause the return type of the iterative

Kill Boost thread with another timeout thread

风格不统一 提交于 2020-01-16 02:02:24
问题 I want to end a thread WorkerThread after a certain amount of time has elapsed. I was thinking to use a second thread TimeoutThread for this, that changes a flag after 15 seconds so the other thread stops. Is there a more elegant way in boost to do this? #include <boost/thread.hpp> struct MyClass { boost::thread timeoutThread; boost::thread workerThread; bool btimeout = true; void run() { timeoutThread = boost::thread(boost::bind(&MyClass::TimeoutThread, this)); workerThread = boost::thread

splitting a boost graph into connected components

送分小仙女□ 提交于 2020-01-15 23:05:55
问题 My program starts out by creating a graph (~1K-50K vertices) that usually consists of a few hundred connected components. The program only needs to be able to manipulate and visualize individual components (using force-directed layout algorithm). It would be great (but not essential) to have the capability of further splitting each connected component into connected subcomponents (by removing edges or vertices). So my question is, can I use use subgraph or filtered_graph class templates to

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

Storing objects in the array

◇◆丶佛笑我妖孽 提交于 2020-01-15 12:47:46
问题 I want to save boost signals objects in the map (association: signal name → signal object). The signals signature is different, so the second type of map should be boost::any . map<string, any> mSignalAssociation; The question is how to store objects without defining type of new signal signature? typedef boost::signals2::signal<void (int KeyCode)> sigKeyPressed; mSignalAssociation.insert(make_pair("KeyPressed", sigKeyPressed())); // This is what I need: passing object without type definition