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
2
votes
3answers
3k views

Calculate the crc32 of the contents of a file using boost

I'm computing the crc32 of a given file using boost: ...
2
votes
2answers
77 views

Storing and loading functions

The class Functions can store/load any functions. It does this by assigning a unique name to every function that gets added. You can then call the function by ...
2
votes
2answers
8k views

time_t to string

...
2
votes
2answers
347 views

Relaying stdin data from one thread to another

I'd like to know if this piece of code is thread-safe. I'm learning something about threads, queues and synchronization, and I'd like to make sure this is correct, before moving forward to next step. ...
2
votes
3answers
2k views

C++ fixed-size queue full/empty signaling

I'm considering an application where a large data needs to be written to file often. I would like to use a queue and have a producer and consumer running on different threads. Additionally, I would ...
2
votes
1answer
739 views

Singleton Boost-based timer

I would like a review on this code, and how I could make it better. ...
2
votes
2answers
71 views

Implementing bounds-checking with exceptions based on an existing bitset container

BitPat here is a wrapper around a bitset. ...
2
votes
1answer
525 views

Producer - Consumer interaction

I have an implementation of Producer-Consumer multi-threaded interaction. It works, but I feel that during the execution wait states happen too often between ...
2
votes
1answer
2k views

Program simulating dictionary using file handling - part 2

This is the new version of the dictionary program which I uploaded for reviewing here. I would be grateful if the program could be reviewed for all the points mentioned in the above link. ...
2
votes
1answer
286 views

ThreadPool based on ASIO, using a particle emitter

This code exists in my home repo and in general nobody else has really touched it. Living in such a vacuum has left me kind of uncertain of the actual code quality and correctness which is why I am ...
2
votes
1answer
79 views

Two error-reporting conventions for a command-parser

I need to implement some function and I would like to report about a fail made inside a function. If function doesn't fail I need to get a some result (for example, ...
2
votes
1answer
112 views

Operator overloading for Boost interval (vectors)

I am a complete newbie to C++ and programming in general. I need to write something for scientific purposes and as such, performance is crucial. I introduced two types, matrices and vectors with ...
2
votes
2answers
172 views

Random Number Generator Followup: Choosing the Generator Algorithm and the Distribution

This question is a follow-up from my previous code review question. This question regards the ability to choose a predefined random number generator algorithm and also choose a generator distribution. ...
2
votes
1answer
5k views

Boost Threads - Producer Consumer threads with synchronization

Please review this for concurrency correctness: ...
2
votes
2answers
1k views

boost::thread producer consumer

I am new toboost::thread and am making a producer-consumer with a Monitor. This is how I've coded it so far: ...
2
votes
0answers
39 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 ...
2
votes
0answers
35 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 ...
2
votes
0answers
438 views

C++ variant and variant subsets

I seem to be in a love-hate relationship with C++. It can make some parts of your code elegant and easy to grasp, and some others become an inconceivable mess. And it's not the language itself causing ...
2
votes
0answers
909 views

Thread-safe LRU cache for C++

I'm working on a simple LRU cache for C++. There's nothing spectacular or unusual about it, but I would like it to be thread safe. (I'm going to be using this for instructional/benchmarking/...
2
votes
0answers
3k views

Multi Server Architecture: ASIO C++

I am working on an application where the user will have flexibility to create and destroy a server instance at any port he/she wishes. User can create multi servers operating simultaneously - each ...
1
vote
1answer
549 views

A class for simple and efficient operations on boost::unordered_set

I wrote this class to perform simple template-set operations on boost::unordered_set. These operations are part of a larger code base. Calling them will be explicit ...
1
vote
1answer
312 views

Implementation of a class that runs a child process with timeout using boost process in async mode

In the following code, I am trying to implement a program that runs a process and returns its return code, stdout and stderr. It ...
1
vote
1answer
206 views

A wrapper on top of boost vector

Please review the following piece of code. The class implements a light weight wrapper on top of boost::container::vector. I am not getting the expected performance — nowhere comparable to std::vector....
1
vote
1answer
336 views

boost::spreadsort for std::pair

Boost 1.58 has new library spreadsort, so I tried it out. I wrote simple sample for sorting vector of pairs of int: ...
1
vote
1answer
223 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: ...
1
vote
1answer
126 views

SDel file deletion utility

SDel is an open-source command-line utility for secure file deletion. (For me personally, it is also an attempt to refresh my knowledge of modern C++ after a long period of using C.) SDel Alpha ...
1
vote
0answers
61 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. ...
1
vote
0answers
66 views

Determining if a regex can be found in a string

I've written my first C++ multithreaded application (as far as I can recall) which determines if a regex can be found in a string. This code works correct to the best of my knowledge. Could you gals/...
1
vote
0answers
2k views

Best practices to pass pcl::PointCloud<PointT> to a function

I am trying to pass a point cloud to a function. Since the point cloud data is huge, I don't want the compiler to make a copy of it while passing. Hence I passed the reference of it as shown below- <...
1
vote
0answers
41 views

Box partitioning with arrays of boost::intervals

I need to write a function that takes a box in space, represented as an std::vector of boost::intervals, and split it into several smaller boxes. First, for convenience, I made some definitions <...
1
vote
0answers
78 views

Pimpl helper class

I have started to utilize the PIMPL pattern in my code. I do not have access to C++11 etc. but do have access to Boost. The code must be able to compile on C++03 compilers. I decided to write a ...
1
vote
0answers
257 views

Boost::python class overloading, issues in exposing more than one constructor

I am very new to boost::python and I am doing the first experiments. The following code works, but how to improve the code exposing also the non empty constructor? Some failed attempts have been ...
1
vote
0answers
328 views

Alternative Boost.Any Library

Since Boost.Any library does not work well with Move-Only types, I had to write my own alternative: ...
1
vote
0answers
536 views

Template based return type from object and class method

I'm looking for a better implementation of this. The current solution looks bad to me and breaks the VC10 compiler if you call Create() with a method expecting two ...
0
votes
1answer
150 views

Traverse directory and store data

During one of assignment, I need to directory and store into proper data structure. I did following way and create to store as tree with multiple child and child will have linked list. Any ...
0
votes
1answer
147 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 ...
0
votes
0answers
21 views

optimization of using boost graph library in solving system of ODE

I tried to use boost graph library for connection of nodes and used a system of ODE on top of connected nodes. Then I compared the code using a 2 dimensional vector instead of graph. Using 2D vector (...
-1
votes
1answer
81 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 ...

1 2 3