boost

C++ Boost.Python : 2 problems

落爺英雄遲暮 提交于 2021-02-07 07:07:16
问题 So, i search good tool to integrate my C++ code with python, and at first i looked at boost.python. I've get hello examle from boost documentation and try to build and run it. Source code is (src/hello.cpp): #include <Python.h> #include <boost/python.hpp> char const* greet() { return "hello, world"; } BOOST_PYTHON_MODULE(hello_ext) { using namespace boost::python; def("greet", greet); } Problem 1 - Windows and mingw I try to build and my result : g++ -o build\hello.o -c -IE:\Programming\libs

C++ Boost.Python : 2 problems

我的未来我决定 提交于 2021-02-07 07:07:03
问题 So, i search good tool to integrate my C++ code with python, and at first i looked at boost.python. I've get hello examle from boost documentation and try to build and run it. Source code is (src/hello.cpp): #include <Python.h> #include <boost/python.hpp> char const* greet() { return "hello, world"; } BOOST_PYTHON_MODULE(hello_ext) { using namespace boost::python; def("greet", greet); } Problem 1 - Windows and mingw I try to build and my result : g++ -o build\hello.o -c -IE:\Programming\libs

Does Boost have unit tests for itself?

我怕爱的太早我们不能终老 提交于 2021-02-07 06:19:06
问题 It is difficult to find information on this because of two reasons: Boost provides a unit test library. I am not referring to this, but have no means of communicating that to Google Building Boost from source involves the custom build system, b2 . Its help flag does not mention anything about tests. I would like to know if boost contains any tests for testing itself. For example many excellent open source libraries and applications have make check or make check-all or make test targets, but I

How to use boost split to split a string and ignore empty values?

醉酒当歌 提交于 2021-02-05 23:47:02
问题 I am using boost::split to parse a data file. The data file contains lines such as the following. data.txt 1:1~15 ASTKGPSVFPLAPSS SVFPLAPSS -12.6 98.3 The white space between the items are tabs. The code I have to split the above line is as follows. std::string buf; /*Assign the line from the file to buf*/ std::vector<std::string> dataLine; boost::split( dataLine, buf , boost::is_any_of("\t "), boost::token_compress_on); //Split data line cout << dataLine.size() << endl; For the above line of

How to use boost split to split a string and ignore empty values?

冷暖自知 提交于 2021-02-05 23:43:52
问题 I am using boost::split to parse a data file. The data file contains lines such as the following. data.txt 1:1~15 ASTKGPSVFPLAPSS SVFPLAPSS -12.6 98.3 The white space between the items are tabs. The code I have to split the above line is as follows. std::string buf; /*Assign the line from the file to buf*/ std::vector<std::string> dataLine; boost::split( dataLine, buf , boost::is_any_of("\t "), boost::token_compress_on); //Split data line cout << dataLine.size() << endl; For the above line of

Are multiple ASIO io_services a good thing?

旧巷老猫 提交于 2021-02-05 20:09:22
问题 I've begun using Boost.ASIO for some simple network programming, my understanding of the library is not a great deal, so please bear with me and my newbie question. At the moment in my project I only have 1 io_service object. Which use for all the async I/O operations etc. My understanding is that one can create multiple threads and pass the run method of an io_service instance to the thread to provide more threads to the io_service . My question: Is it good design to have multiple io_service

Are multiple ASIO io_services a good thing?

≯℡__Kan透↙ 提交于 2021-02-05 20:00:28
问题 I've begun using Boost.ASIO for some simple network programming, my understanding of the library is not a great deal, so please bear with me and my newbie question. At the moment in my project I only have 1 io_service object. Which use for all the async I/O operations etc. My understanding is that one can create multiple threads and pass the run method of an io_service instance to the thread to provide more threads to the io_service . My question: Is it good design to have multiple io_service

How do I install the boost library to my MinGW compiler?

风流意气都作罢 提交于 2021-02-05 15:34:44
问题 I'm compiling from the command line using g++ on a Windows MinGW installation. How do I get boost...conceptually or if it is easy...what do I need to download and install? 回答1: I know this is an old question but for future reference for anybody coming to this page try this website, http://nuwen.net/mingw.html They have done all the hard work so you don't have to. The most recent distribution on this page has boost 1_52_0 (which is the latest version on the boost website as I'm writing this)

The uniqueness of UUID generated using Boost library vs Java

孤街浪徒 提交于 2021-02-05 08:55:07
问题 An Android app from my organization needs to assign each users an UUID(version 4) when they first launch the app, currently we're using Boost library 1.58.0 for this purpose, our Android app will use JNI to run the code below for generating UUIDv4: boost::uuids::basic_random_generator<boost::random::lagged_fibonacci44497> generator; generator(); //generating UUIDv4 The code worked fine for years, now we're deciding to replace it with an API in Java(UUID.randomUUID()). But we think it would be

Parse a '.' chained identifier list, with qi::lexeme and prevent space skipping

丶灬走出姿态 提交于 2021-02-05 08:21:33
问题 im currently working on a Spirit based Expression Parser that should allow in the end (far far in the future) expressions like "a*b*c" "10+20*x.y.z" "a.b.c[ a.b ][ e.c( d.e()*4 )].e.f( (a.b+23)*d, -23*b.e(a.b.c) ).x.y" wild mix of member accesses, array subscriptions, function calling and expressions [] -> subscription () -> function call or expression bracket . member chaining currently im fighting with the space skipping on member-chaining "a . b . c" is not valid in my world - but gets