28,101 questions
0
votes
1
answer
32
views
Cmake 4.1 Can't Find boost_headers-config.cmake
I'm using cmake 4.1 with boost 1.88.0. I set BOOST_ROOT to C:\boost_1_88_0
The problem happens because cmake finds BoostConfig.cmake in C:\boost_1_88_0\tools\cmake\config, which calls find_package() ...
2
votes
1
answer
58
views
Boost.Beast async_connect fails after upgrading Boost 1.78 to 1.89
I have a Websocket class that connects asynchronously using Boost.Asio and Boost.Beast. The following code was working fine with Boost 1.78, but after updating to the latest Boost version, I now get a ...
4
votes
1
answer
112
views
Boost Asio Timer interruption after signal is handled
I have the following program that just runs a timer for 5 seconds and has a signal handler.
#include <boost/asio.hpp>
#include <chrono>
#include <iostream>
#include <signal.h>
...
0
votes
1
answer
92
views
How do I find Boost date_time in CMake by using vcpkg?
I have vcpkg 2025-09-03 installed and CMake 4.1.2 installed.
Now I want to install Boost Date-Time
.\vcpkg.exe install boost-date-time
And check if boost-date-time is installed.
PS C:\Users\negrå\...
4
votes
1
answer
94
views
missing-field-initializers warning for 3rd party dependency base class
I am getting a warning (turned into an error with -Werror) about missing-field-initializers when using designated initializers for the fields in my struct, because I'm not initializing fields in a 3rd ...
2
votes
1
answer
125
views
When does socket::is_open return false?
Suppose I accept a socket by calling async_accept like this
acceptor.async_accept([](const boost::system::error_code& ec, boost::asio::ip::tcp::socket sock)
{
if (ec)
return;
auto sess = std:...
0
votes
0
answers
42
views
boost, like parallel_group but runtime determined number of tasks [duplicate]
I have some courtine tasks that return an asio::awaitable<...> - possibly different types (but yes, I know what they supposed to return).
I want to run them in parallel and wait for all of them ...
0
votes
0
answers
99
views
building boost with b2 on windows msys2 ucrt64 clang produces windows/visual c++ style binaries rather than posix style ones
I'm trying to build boost on windows (currently windows 10 because my pc sadly doesn't have the tpm) with clang from msys2/mingw64/ucrt. To be clear, I have these infos from my current clang:
clang++ -...
0
votes
0
answers
222
views
How to use boost::asio::co_spawn with boost::thread::future?
I'm trying to use asio::co_spawn with boost::future in Thread library, such that I could chain the co_routine task with then() function. But the problem is asio::use_future only generates std::future. ...
2
votes
1
answer
156
views
How to parse multipart/form-data from http::request<http::string_body> object?
I am reading a http::request<http::string_body> request from the network using boost::beast, which is of type multipart/form-data. The request contains files and strings.
How can I get each part ...
4
votes
1
answer
496
views
Converting pointer-to-member to member index using Boost.PFR without creating an object
Consider the following struct:
struct Particle
{
float scale;
float opacity;
float rotation;
};
I want the following to compile:
static_assert(indexOf<&Particle::scale>() == 0);
...
7
votes
2
answers
177
views
How to convert std::chrono::system_clock::now() to boost::mysql::datetime::time_point
I'm using the boost mysql library in a project. I need to use boost::mysql::datetime (datetime) to represent timestamps. A datetime value can be constructed from a boost::mysql::datetime::time_point.
...
0
votes
1
answer
48
views
Compiling boost for use with mex on Windows 11
I can't compile the boost library on Windows 11, specifically serialization which is not header-only, for use with mex in MATLAB. I am compiling boost with .\bootstrap.bat; .\b2.exe link=static ...
3
votes
1
answer
132
views
Call boost::asio::post for io_context which runs in another thread
I have two threads and I need to run a task from the first thread but in such a way that the task is executed in the second thread.
For this I decided to use boost::asio::post, but I'm not sure if it ...
3
votes
1
answer
99
views
Is it correct to reset the connection in websocket::stream_base::decorator callback?
I have a websocket server where I call websocket::stream::async_accept to perform a handshake with the client.
I also set a decorator to modify the headers like this
conn->get_websocket_stream()....
4
votes
1
answer
63
views
Does http::response_parser inherits limits from source parser?
I create http::response_parser<http::buffer_body> and set header_limit and body_limit like this
auto parser = std::make_shared<http::response_parser<http::buffer_body>>();
parser->...
1
vote
1
answer
125
views
ssl::stream::shutdown sometimes does not complete
I want to close the TLS connection gracefully. So before closing the socket I call ssl::stream::shutdown. I call ssl::stream::shutdown in the session destructor and at that moment I have no active ...
1
vote
1
answer
67
views
WebSocket interface binding not working with Boost.Beast - socket still uses default interface
I'm trying to bind a WebSocket connection to a specific network interface using Boost.Beast, but the socket keeps using the default interface instead of the specified one.
I have a WebSocket client ...
3
votes
1
answer
149
views
Correct way to call ssl::stream::async_shutdown
Is it correct to call ssl::stream::async_shutdown while there are outstanding async_read_some/async_write operations? Should I wait for all async operations to complete before calling ssl::stream::...
2
votes
1
answer
87
views
compiler errors when trying to use modify function in boost multiindex when looping over a specific iterator?
I have made a boost multiindex of my GameObject, and I am trying to loop through and call non const functions on it. And I cannot for the life of me to get boost to stop giving long nasty compiler ...
1
vote
1
answer
141
views
How do I use boost::catmull_rom for time series interpolation?
I want to implement Catmull-Rom interpolation for a time series of data sampled at irregular intervals. I noticed that Boost provides catmull_rom in its interpolation library, and I have tried to use ...
1
vote
1
answer
96
views
Why doesn't boost::asio::async_initiate or async_compose automatically call the handler via its bound executor
Code firstly, very simple example code:
template <typename CompletionToken>
decltype(auto) test_initiate(CompletionToken&& token) {
return boost::asio::async_initiate<...
2
votes
1
answer
118
views
Access the http response body before the entire response has been read
I need to read the response from an HTTP server like this:
first call boost::beast::http::async_read_header to get headers,
then read the response body (if any).
To read the body I use boost::beast::...
1
vote
2
answers
84
views
How can I pass a parameter to a parser in Boost.Parser?
Please note that I am asking about Boost.Parser, not the older Boost.Spirit.
I have a reference to a symbols object that I want to use in a parsing rule. I think I want to use a parameter for that, ...
1
vote
1
answer
159
views
Boost::process::v1::child is not working with the Arguments of boost::process::child
I changed the process::child to process::v1::child. I got an error so i did some research. I found that i should put the Args into an vector of wstring. But that didn't change anything.
I did a ...