2022 Developer Survey is open! Take survey.

Questions tagged [boost]

Boost is a large collection of high-quality libraries intended for use in C++. Boost is free, and is often considered a "second standard library".

Filter by
Sorted by
Tagged with
3 votes
0 answers
46 views

boost-asio reverse proxy

I wrote reverse proxy using boost::asio. The idea is to send client's data to two external servers and send back response from one of them. Here is my code: ...
user avatar
2 votes
0 answers
92 views

A reuseable reconnecting TCP socket with Asio

I'm using (non-boost) Asio 1.18.1 and C++17. Forgive the boost tag, there wasn't a more specific one. I have a async_connect_with_retry composed asynchronous ...
user avatar
  • 153
2 votes
3 answers
136 views

Fixed-size memory allocator

I've been trying to implement a simple Boost PMR allocator that has a fixed amount of memory. My first implementation (which can be found here) had undefined behavior and did not handle memory ...
user avatar
  • 31
2 votes
0 answers
536 views

Implement Websocket using boost::asio::beast with serialized writes

Here's a proposal implementation of websocket using boost::asio::beast that is thread-safe to parallel writes. In this example below, the ...
user avatar
  • 153
1 vote
1 answer
70 views

Unit Tests for the operators of image template class with Boost.Test framework in C++

This is a follow-up question for Tests for the operators of image template class in C++. As G. Sliepen's answer mentioned, I am attempting to use Boost.Test and several test cases are created with <...
user avatar
  • 3,302
2 votes
1 answer
86 views

Makefile that compiles to two separate executables

I'm working on a project that will have both a server and a client, using Boost's ASIO library for networking. I'm not really comfortable working with Makefiles, but, with some help from Chase Lambert'...
user avatar
3 votes
3 answers
642 views

Connect to telnet server

I've just started to learn C++. I have this class and I don't know where to put the following two lines because of the catch: delete[] chost; delete[] cport; I ...
user avatar
1 vote
0 answers
65 views

A recursive_transform template function for the binary operation cases with execution policy in C++

This is a follow-up question for A recursive_transform template function for the binary operation cases in C++, A recursive_transform Template Function with Unwrap Level for Various Type Arbitrary ...
user avatar
  • 3,302
0 votes
1 answer
43 views

extents_to_array and array_to_extents functions for Boost.MultiArray in C++

This is a follow-up question for A get_extents helper function for Boost.MultiArray in C++. In order to retrieve, manipulate and calculate size information in each dimension from Boost.MultiArray in ...
user avatar
  • 3,302
0 votes
1 answer
25 views

Simple runtime profiler for executable files

I'm sure there are several profilers written in C++ on here already, though with this one the goals are quite different. I attempted to make it as robust as possible, or 'fool-proof' if you will so ...
user avatar
2 votes
1 answer
164 views

Network library based on boost::asio

I'm currently trying to develop an easy to use TCP networking library based on boost::asio. This is my first attempt to work with ...
user avatar
  • 21
3 votes
2 answers
179 views

Nested std::deque and std::vector Type Test Cases for recursive_transform Template Function in C++

This is a follow-up question for A recursive_transform Template Function Implementation with std::invocable concept in C++, A recursive_transform Template Function ...
user avatar
  • 3,302
5 votes
1 answer
145 views

A Various Container Type Arbitrary Nested Iterable Generator Function Implementation in C++

This is a follow-up question for std::array and std::vector Type Arbitrary Nested Iterable Generator Functions Implementation in C++ and std::deque and std::list Type Arbitrary Nested Iterable ...
user avatar
  • 3,302
6 votes
1 answer
133 views

Non-nested std::deque and std::list Generator Function for arithmetic_mean Function Testing in C++

This is a follow-up question for A non-nested test_vectors_generator Function for arithmetic_mean Function Testing in C++ and An arithmetic_mean Function For Various Type Arbitrary Nested Iterable ...
user avatar
  • 3,302
1 vote
0 answers
52 views

A non-nested test_vectors_generator Function for arithmetic_mean Function Testing in C++

This is a follow-up question for An arithmetic_mean Function For Various Type Arbitrary Nested Iterable Implementation in C++. As Toby Speight's answer mentioned, some self-checking unit tests are ...
user avatar
  • 3,302
1 vote
1 answer
93 views

A get_extents helper function for Boost.MultiArray in C++

This is a follow-up question for A filled_multi_array Template Function for Boost.MultiArray in C++. Based on G. Sliepen's answer, there is another get_extents ...
user avatar
  • 3,302
3 votes
1 answer
74 views

A filled_multi_array Template Function for Boost.MultiArray in C++

This is a follow-up question for A ones Function for Boost.MultiArray in C++. Thanks to G. Sliepen's answer, the mentioned method which can set various initial value is better in generic purpose usage....
user avatar
  • 3,302
2 votes
1 answer
111 views

A ones Function for Boost.MultiArray in C++

This is a follow-up question for An Element-wise Increment and Decrement Operator For Boost.MultiArray in C++ and A recursive_transform Template Function for BoostMultiArray. I am trying to implement ...
user avatar
  • 3,302
1 vote
1 answer
75 views

An Element-wise Increment and Decrement Operator For Boost.MultiArray in C++

This is a follow-up question for A recursive_transform Template Function for BoostMultiArray and An Add/Minus Operator For Boost.MultiArray in C++. Besides the add / minus operator for Boost....
user avatar
  • 3,302
2 votes
1 answer
87 views

A recursive_transform Template Function for BoostMultiArray

This is a follow-up question for A Sine Template Function For Boost.MultiArray in C++, A recursive_transform for std::array with various return type, A recursive_transform for std::vector with various ...
user avatar
  • 3,302
2 votes
1 answer
60 views

A Sine Template Function For Boost.MultiArray in C++

This is a follow-up question for An element_wise_add Function For Boost.MultiArray in C++. Besides the basic add operation applying onto each element, I am trying to implement a sine template function ...
user avatar
  • 3,302
3 votes
0 answers
121 views

An element_wise_multiplication and an element_wise_division Function For Boost.MultiArray in C++

This is a follow-up question for An element_wise_add Function For Boost.MultiArray in C++ and An Add/Minus Operator For Boost.MultiArray in C++. Besides the basic element-wise add / minus operations, ...
user avatar
  • 3,302
4 votes
1 answer
125 views

An Add/Minus Operator For Boost.MultiArray in C++

This is a follow-up question for An element_wise_add Function For Boost.MultiArray in C++. The following code is the improved version based on G. Sliepen's answer. On the other hand, the built-in ...
user avatar
  • 3,302
3 votes
1 answer
93 views

An element_wise_add Function For Boost.MultiArray in C++

This is a follow-up question for A Summation Function For Boost.MultiArray in C++. Besides the summation operation of all elements, I am trying to focus on the element-wise operation here. The main ...
user avatar
  • 3,302
4 votes
1 answer
191 views

A Summation Function For Boost.MultiArray in C++

This is a follow-up question for A Summation Function For Arbitrary Nested Vector Implementation In C++ and A Summation Function For Various Type Arbitrary Nested Iterable Implementation in C++. I am ...
user avatar
  • 3,302
4 votes
1 answer
284 views

Boost.Asio Server and RAII

I am trying to implement a network server application in C++ using Boost.Asio. Here are the requirements I am trying to meet: The Application creates only one instance of ...
user avatar
  • 141
2 votes
1 answer
762 views

Async tcp socket client: send multiple requests with one connection

I'm new to socket programming and c++. I have a the following method that sends an array to server and receives sum of the array, I tried to make it async. ...
user avatar
  • 23
3 votes
0 answers
50 views

Yet another reflection library

Tried to do my own implementation of reflection(introspection) for using in my next projects. Is it optimized at compile time? If no, how can I improve it? This macro is good interface for adapting ...
user avatar
6 votes
1 answer
477 views

Using Boost.Spirit to transform expression to AST

Is there a better way to transform some expression to AST using Boost.Spirit? I have built it, but I think it's messy and can be simplified a lot. Code is also available on Godbolt. ...
user avatar
1 vote
1 answer
93 views

Implementing boost::upgrade_mutex using only standard locks

Is this my_upgrade_mutex class a valid implementation of boost::upgrade_mutex semantics? (Ignoring the ...
user avatar
  • 137
2 votes
0 answers
25 views

Using Boost's Runge-Kutta integration capability in a templated mathematical model

This is my first time using Boost and templates in general, so I'm mostly looking for a style critique on my C++. In particular, I'd like feedback on: state_type, ...
user avatar
2 votes
1 answer
3k views

C++ Sorting Filenames In A Directory

I wanted to have some advice about the code I have. I managed to get what I wanted done, but I do not think it is the "proper" way of doing it in the programmers' world. Could you help me improve ...
user avatar
  • 23
2 votes
1 answer
105 views

"Structure of arrays" wrapper

I was looking into SOA to better utilize SIMD instructions. I implemented a generic wrapper object that lets you chose the amount of individual vectors each structure consists of. I am using xsimd and ...
user avatar
  • 299
5 votes
2 answers
381 views

A Matrix Library in C++;

I have written a Matrix library that contains all the main properties of matrices. It's a relatively long project, I am hoping it is ok to post here since I really want to have it reviewed. The ...
user avatar
  • 345
1 vote
0 answers
549 views

Implementing boost::asio's async_read_some

I need to implement async_read_some from Boost Asio. The reason is here https://stackoverflow.com/questions/59223064/implementing-behaviour-of-boostasio-for-a-class but I don't think it's relevant. ...
user avatar
  • 111
3 votes
0 answers
63 views

Fibonacci and Lucas sequence generator using Boost and GMP

I implemented this console application that generates Fibonacci and Lucas sequence numbers using boost and GMP for multiprecision. There is an iterator-like class which can do any sequence based on ...
user avatar
  • 3,945
2 votes
0 answers
45 views

program options from command line initialize [v3 - after CR]

After my previous code review, I'm sharing my new code, and asking for better ways (which always exist) to improve the code, even with new libraries. The only thing that important to me, is the way of ...
user avatar
  • 267
6 votes
1 answer
115 views

program options from command line initialize [v2 - after CR]

After getting a CR from @pacmaninbw and @ALX23z here, I want to share my new code, and to ask for better ways (which always exist) to improve the code, even with new libraries. The only thing that ...
user avatar
  • 267
3 votes
2 answers
432 views

program options from command line initialize

I'd like to receive a CR for the following command-line program options' initializing using boost::program_options. I'd like to know if there is a better way of ...
user avatar
  • 267
3 votes
1 answer
415 views

Producer consumer with threads and using boost ring buffer

I have two threads, one is the producer and other is consumer. My consumer is always late (due to some costly function call, simulated in below code using sleeps) so I have used ring buffer as I can ...
user avatar
7 votes
1 answer
316 views

Parallel Ramanujan's formula for 1/π calculation

I finished my university project for calculating \$1/\pi\$ and I would love to get some feedback. Before you guys jump into this code please keep in mind newcomer to C++ just decided to use it for ...
user avatar
  • 423
3 votes
1 answer
117 views

A matrix-vector multiply parallelized using boost::MPI

This program performs a matrix-vector multiply using MPI to split the computation up. It is not extremely robust (for example, it doesn't handle the case where the number of MPI processes does not ...
user avatar
  • 287
5 votes
1 answer
1k views

C++ observer pattern via boost.signals2

I was looking for a thread safe implementation of the observer pattern. I read https://xinhuang.github.io/posts/2015-02-11-how-a-multi-threaded-implementation-of-the-observer-pattern-can-fail.html and ...
user avatar
  • 153
3 votes
1 answer
178 views

Using boost::mpi to take the Euclidean norm of a vector

I am learning MPI (via boost::mpi) and wrote this program that takes the euclidean norm of a 1-D vector (represented as an array here.) I want to make sure that I ...
user avatar
  • 287
3 votes
0 answers
297 views

Calculate huge Fibonacci Numbers in C++ using GMP and boost::multiprecision

Problem Statement Calculate the exact value of the n-th Fibonacci number, say the one-billionth. Algorithm The algorithm is based on the idea that Fibonacci numbers can be represented as 2x2 ...
user avatar
  • 131
4 votes
1 answer
319 views

Automatic Differentiation with C++ Header-Only Library

Code review/feedback is requested and appreciated for the following open-source automatic differentiation C++ header-only library released under the Boost License. I am the author. https://github.com/...
user avatar
  • 143
1 vote
1 answer
659 views

C++ game server

I'm writing a server for an MMO game using boost::asio. I would like to know, are there any design or other issues in my code? And what should I improve in it? Thanks in advance. BaseServer.h: ...
user avatar
0 votes
1 answer
281 views

Use of a single member struct as an attribute with boost::spirit::karma generators

Original Problem The original problem is parsing/generation of the transport header of the RTSP protocol, see RFC 2326 12.39 Transport, Page 60. The transport header is defined of multiple transport ...
user avatar
3 votes
2 answers
1k views

Run an asynchronous child process with timeout

In the following code, I implement a class that starts a process and returns its return code, stdout and stderr. It also has a ...
user avatar
  • 169
-1 votes
1 answer
174 views

How to use a predicate to create or filter vector [closed]

I have function which returns a vector or strings (values from an sqlite3 table). For each of those strings I need to generate a Qt Checkbox, if it does not exist yet. My first version looks like ...
user avatar