boost

Yocto Project Boost library : Change default package version used in bitbake recipe

大城市里の小女人 提交于 2021-01-28 05:06:18
问题 I am developing a Linux image operating system using Yocto Project . I am using SUMO branch ( Yocto Project 2.5 ). In order to install the boost library in my Linux image, I added this line to the local.conf file : IMAGE_INSTALL_append = " boost" But I discover that the default version installed is Boost 1.66.0 . Under meta/recipes-support/boost directory I can find three files : recipes-support/boost/boost_1.66.0.bb recipes-support/boost/boost-1.66.0.inc recipes-support/boost/boost.inc I

How to convert a single object to a boost::any_range?

岁酱吖の 提交于 2021-01-28 04:56:13
问题 I'm trying to create and return a boost:any_range that contains only one object (I don't know if that's the core problem) but I get the following errors: error C2893: Failed to specialize function template 'range_iterator<C,void>::type boost::range_adl_barrier::begin(T &)' note: With the following template arguments: note: 'T=const WrappedRange' error C2672: 'end': no matching overloaded function found error C2893: Failed to specialize function template 'range_iterator<C,void>::type boost:

boost: readline for tcp client

拟墨画扇 提交于 2021-01-28 04:20:45
问题 I'm developing a tcp server in c++ using boost. I'd like process incoming data line by line and am looking for a socket.readLine method. However, I can only find a read_some() method. I don't what the definition on "some" is, but I don't think the string necessarily ends with a "\n". So how can I implement socket.readLine() using boost? 回答1: I assume you are using boost::asio. If so, there is a read_until() function that does what you want. http://www.boost.org/doc/libs/1_47_0/doc/html/boost

Filtering folders in Boost Filesystem

為{幸葍}努か 提交于 2021-01-28 04:06:55
问题 I want to get all the files inside a concrete folder (in this case Documents) with Boost Filesystem in Windows. For this I make a filter to assure I get no folders. The problem is that when I still get the following folders : "C:\....\Documents\My Videos", "C:\....\Documents\My Music", "C:\....\Documents\My Pictures" (I don't get some other folders) The code is the following: boost::filesystem::directory_iterator end; for (boost::filesystem::directory_iterator iter(documentsFolder); iter !=

Writing boost::multiprecision data type to binary file

两盒软妹~` 提交于 2021-01-28 04:02:18
问题 I was using the boost::multiprecision::uint128_t type in order to perform bitwise operations on a 128 bit value. However I am having trouble writing the 128 bit value out to a binary file. Specifically with the need to pad out the value with zeros. As an example if the uint128_t value was 0x123456 then looking at the file in the hex editor I would want the sequence: 56 34 12 00 00 00 00 00 00 00 00 00 00 00 00 00 #include <boost/multiprecision/cpp_int.hpp> #include <fstream> boost:

What does {error C2338: (boost::has_trivial_destructor<T>::value)} mean for boost::lockfree::queue ? What am I missing here? [duplicate]

雨燕双飞 提交于 2021-01-28 03:25:27
问题 This question already has answers here : /boost/lockfree/queue.hpp: error: static assertion failed: (boost::has_trivial_destructor<T>::value) (3 answers) Closed 7 years ago . I have a struct MyClass inside another class MyOuterClass I am trying to put into a boost::lockfree::queue. My structure looks like below struct MyClass { MyClass() {} MyClass(const string& topic, const string& multicastChannel, const string& netInterface, MyOuterClass::MY_COMMAND_ENUM command, MyOuterClass::CallbackType

Using boost::function with a parameter to shared pointer to derived class

梦想的初衷 提交于 2021-01-28 03:22:34
问题 Using C++ with g++ 5.4.0 on Ubuntu 16.04. I have a class A, and a class B that derives from class A. Function f1 takes a shared pointer to class A as parameter. Function f2 takes a shared pointer to class B as parameter and return the same type as f1. Using boost::function, another function F takes a function such as f1 as parameter. The code looks like this : result_t f1 ( const boost::shared_ptr<A> a ); result_t f2 ( const boost::shared_ptr<B> b ); typedef boost::function < result_t (const

Use of optional parser in spirit qi

我只是一个虾纸丫 提交于 2021-01-28 02:57:16
问题 I'm trying to parse either an additive expression of the form "A+C", or "A" alone. After a few tests I realized that the problem is apparently my use of the optional parser, so to exemplify: qi::rule<string::iterator, string()> Test; Test = ( qi::string("A")[qi::_val= qi::_1] >> -( qi::string("B")[qi::_val += qi::_1] >> qi::string("C")[qi::_val += qi::_1] ) ) ; string s1, s2; s1 = "AB"; bool a= qi::parse(s1.begin(), s1.end(), Test, s2); The idea is to parse 'A' or "ABC", but if the s1 value

Mocking a boost shared memory derived class with gtest

强颜欢笑 提交于 2021-01-28 02:54:34
问题 I have a simple CPP class storing some configuration of my project. This class is stored using boost interprocess shared memory, and so can be accessed from different processes running on my server. Now, I would like to run some tests on my program- so I wish to mock the functionality of my shared-memory-object. In order to do that with gtest, I've created a base configuration class, which my mock class and my shared memory class will derive from. In order to use gtest correctly, the base's

Where are template methods instantiated?

让人想犯罪 __ 提交于 2021-01-28 01:50:35
问题 In order to use an incomplete type with a smart pointer such as boost::scoped_ptr , one must explicitly define an empty destructor for the parent class in the corresponding CPP file. Example: // H file class Foo { public: ~Foo(); private: class Pimpl; boost::scoped_ptr<Pimpl> pimpl_; }; // CPP file class Foo::Pimpl {}; Foo::~Foo() {} Where exactly does the compiler place the instantiation of boost::scoped_ptr 's destructor? I'm trying to visually imagine where it would be in either of these