28,084 questions
Score of 0
1 answer
136 views
How can I return an optional Boost::JSON object?
I am not sure whether the std::move is helpful here, but I want to avoid unnecessary copies and the code still doesn't compile without it, anyway.
#include <boost/optional.hpp>
#include <...
Score of 2
0 answers
159 views
CMake finds boost, but can't find Boost::process - how come?
I'm configuring a CMake project which has the following line in `CMakeLists.txt`:
find_package(Boost ${BOOST_VERSION} REQUIRED CONFIG
COMPONENTS ${BOOST_REQ_COMPONENTS}
OPTIONAL_COMPONENTS ...
Score of 2
1 answer
70 views
Unexpected behaviour of boost::find_all_regex?
Should boost::find_all_regex match two overlapping words like in the example below? Only two "two" are matched as far as I tested for the string "twonetwo" (note the overlapping &...
Advice
1
vote
13
replies
102
views
How to create a map-like interface for std::vector, or how to treat a vector as an index-value map?
I do things with maps (could be std::map or another map from the standard library, a boost map, a custom map from another library, etc):
template<class T>
void do_map_stuff(T const& t)
{
...
Score of 0
1 answer
52 views
BoostConfig.cmake not found in sysroot builded from buildroot
A small Linux distribution is being built using buildroot. A set of Boost libraries is added to it. The problem is that starting from cmake version 3.30, the configuration mode (find_package(Boost ...
Score of -2
1 answer
104 views
keep the server running without using std::getline or boost::asio
How can I keep the server running without using std::getline or boost::asio ?
Does cpprest provide any interfaces for this?
Using boost::asio can achieve this, but does cpprest provide any other ...
Score of 3
2 answers
135 views
Pass a logger to boost::json::tag_invoke
I want to serialize and deserialize a class with boost::json by using tag_invoke. This is a snippet of my actual code:
#include "GeometricSerializer.hpp"
#include "BoundingBoxSerializer....
Score of 2
1 answer
107 views
Boost.Parser: Unexpected type for attribute
I'm currently building an expression parser in Boost.Parser. It should be able to do
Parentheses ( ( ... ) ) and abs ( | ... |)
Unary minus
Power ( x^y)
(other arithmetic operations, not relevant for ...
Score of 3
1 answer
168 views
How to read and write to cmd with boost::process
I am trying to create a simple app , which will open cmd and write commands to cmd one by one . and read the output one by one . I don't want to launch separate cmd for each command . because some ...
Score of 2
1 answer
125 views
What's going on with asio::async_compose?
The following code snippet produces a compilation error:
error: deduced type 'void' for 'err' is incomplete.
What I don't understand is this. Shouldn't err be of type error_code?
#include <boost/...
Advice
1
vote
5
replies
69
views
Solving an equation containing a singularity in Boost odeint
When converting a differential equation (DQ) to a system of first-order DQs, if the term in the original DQ with the highest derivative has a variable coefficient, dividing by that coefficient may ...
Score of 1
0 answers
130 views
Using boost::asio::async_wait with Native recvfrom() Calls: Is It Correct?
Suppose we are waiting for incoming data on a socket using the call socket::async_wait(socket::wait_read, callback). After the callback notifies us that data is available, is it possible to read the ...
Score of 2
1 answer
196 views
Is it possible to apply rate limiting to UDP sockets in Boost?
As is well known, in Boost we can use a rate limit to restrict the read and write speed of a TCP stream, as indicated in the documentation: https://www.boost.org/doc/libs/latest/libs/beast/doc/html/...
Score of 0
2 answers
423 views
Boost.Unordered unordered_flat_map: why does it need sentinel?
I've been going through Boost's unordered_flat_map implementation. Here's an overview:
https://www.boost.org/doc/libs/latest/libs/unordered/doc/html/unordered/structures.html#...
Score of 1
1 answer
114 views
How to get boost::process to invoke docker from anywhere?
Boost version 1.74
Docker version 28.2.2
A toy program works when invoked from its build directory:
$ cd build
$ ./test
27610c1a6b49a0f459fc9e39a374f2e5b9b5e3175b0e926af4c7359c6bd7f93f
but when ...