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
1 answer
62 views

C++ Readers-Writer Lock using Asio's Strands

The locking mechanism is implemented in the class RW_Lock. The saved_async_completion_handler structure is used in ...
DeltA's user avatar
  • 133
2 votes
1 answer
59 views

API Implementation guidance and improvement

I have recently made significant progress in overcoming beginner barriers related to using Git, CMake, libraries, and successfully implementing an API in C++. Despite my achievements, I acknowledge ...
user avatar
2 votes
1 answer
363 views

Tool for asynchronous IPC using pipes

Description of the code: The code provides asynchronous IPC functionality in C++ using the Boost libraries and pipes. Each process asynchronously "listens" on the read end of the pipe and ...
kasra's user avatar
  • 123
-2 votes
1 answer
288 views

How can I optimize C++ serialization? [closed]

I want to serialize a C++ class Ramdomclass . Below is the serialization function. ...
Sebastian Orteho's user avatar
0 votes
1 answer
334 views

What can I do better in my C++ serialization implementation?

I want to serialize a class Mango recursively. ...
James_sheford's user avatar
3 votes
2 answers
4k views

Printing a C++ struct

Critique? ...
user1095108's user avatar
  • 1,414
0 votes
1 answer
209 views

Parallelise numerical integration with OpenMP in C++

I would like to parallelise with OpenMP a one-dimensional integral using the integrate() function implemented in the Boost library. I found a rather obscure ...
CafféSospeso's user avatar
3 votes
0 answers
298 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: ...
rudolfninja's user avatar
2 votes
0 answers
811 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 ...
MHebes's user avatar
  • 143
2 votes
3 answers
272 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 ...
Kory's user avatar
  • 31
2 votes
0 answers
2k 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 ...
Zohar81's user avatar
  • 153
1 vote
1 answer
227 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 <...
JimmyHu's user avatar
  • 3,918
2 votes
1 answer
170 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'...
Spiwocoal's user avatar
3 votes
3 answers
1k 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 ...
VansFannel's user avatar
1 vote
0 answers
68 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 ...
JimmyHu's user avatar
  • 3,918
0 votes
1 answer
65 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 ...
JimmyHu's user avatar
  • 3,918
0 votes
1 answer
34 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 ...
Jack Avante's user avatar
2 votes
1 answer
427 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 ...
Cian's user avatar
  • 21
4 votes
2 answers
324 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 ...
JimmyHu's user avatar
  • 3,918
6 votes
1 answer
173 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 ...
JimmyHu's user avatar
  • 3,918
6 votes
1 answer
151 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 ...
JimmyHu's user avatar
  • 3,918
1 vote
0 answers
58 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 ...
JimmyHu's user avatar
  • 3,918
1 vote
1 answer
122 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 ...
JimmyHu's user avatar
  • 3,918
3 votes
1 answer
113 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....
JimmyHu's user avatar
  • 3,918
2 votes
1 answer
126 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 ...
JimmyHu's user avatar
  • 3,918
1 vote
1 answer
83 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....
JimmyHu's user avatar
  • 3,918
3 votes
1 answer
105 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 ...
JimmyHu's user avatar
  • 3,918
2 votes
1 answer
76 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 ...
JimmyHu's user avatar
  • 3,918
3 votes
0 answers
150 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, ...
JimmyHu's user avatar
  • 3,918
4 votes
1 answer
140 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 ...
JimmyHu's user avatar
  • 3,918
3 votes
1 answer
121 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 ...
JimmyHu's user avatar
  • 3,918
5 votes
1 answer
260 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 ...
JimmyHu's user avatar
  • 3,918
4 votes
1 answer
579 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 ...
MarekR's user avatar
  • 141
2 votes
1 answer
2k 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. ...
Abraham's user avatar
  • 23
3 votes
0 answers
94 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 ...
Vladyslav Mozhvylo's user avatar
6 votes
1 answer
1k 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. ...
Vladyslav Mozhvylo's user avatar
1 vote
1 answer
176 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 ...
zwhconst's user avatar
  • 137
2 votes
0 answers
52 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, ...
ijustlovemath's user avatar
2 votes
1 answer
4k 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 ...
beluga's user avatar
  • 23
2 votes
1 answer
177 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 ...
Yamahari's user avatar
  • 299
5 votes
2 answers
439 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 ...
HBatalha's user avatar
  • 345
1 vote
0 answers
769 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. ...
PPP's user avatar
  • 111
3 votes
0 answers
71 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 ...
slepic's user avatar
  • 5,357
2 votes
0 answers
56 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 ...
Coral Kashri's user avatar
6 votes
1 answer
147 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 ...
Coral Kashri's user avatar
3 votes
2 answers
738 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 ...
Coral Kashri's user avatar
3 votes
1 answer
686 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 ...
noman pouigt's user avatar
7 votes
1 answer
375 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 ...
kuskmen's user avatar
  • 413
3 votes
1 answer
192 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 ...
Luciano's user avatar
  • 297
5 votes
1 answer
2k 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 ...
Max's user avatar
  • 153