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".

32 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
5k views

I am using boost::process to call an external process, and using stdout, stderr, and stdin to supply/retrieve data

I have some program which takes input via stdin, writes output to stdout, and errors to stderr. I would like to call that program from another program, supplying data via stdin, and capturing output/...
5
votes
0answers
413 views

Quasi-Random Number Generators

I would like to communicate a piece of code which I hope will soon be broadly useful for everyone who programs in C++: A set of quasi-random number generators proposed for addition to boost.random. To ...
5
votes
0answers
552 views

A full-duplex connection to an IRC server

This connection class can be used, through composition, to make IRC clients for different kinds of IRC services. ...
4
votes
0answers
679 views

Boost Asio Listener

I have developed a piece code to listen on a socket using Boost::asio. I would like to use that code in production. But before that, I would like to test it and ...
4
votes
0answers
130 views

Accept constructor arguments from a given subset of types

I found myself often in the position that I want to have multiple arguments in a constructor which could be in any order. For example: ...
4
votes
0answers
179 views

Reading Intervals from command line

I want to parse a command line using boost.program_options. Most of my command line arguments will be intervals, which I could implement as something like ...
4
votes
0answers
3k views

Event system using callback functions in C++

I am learning C++ and have been trying to create an event system for use in a small game. This will be the mechanism by which game entities communicate. I would be eternally grateful if someone with ...
3
votes
0answers
97 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 ...
3
votes
0answers
68 views

C++ Trie implementation with Python wrapper

I'm just starting to use C++ so beginner feedback is fine here. CPP code (main.cpp, node.h, node.cpp, trie.h, trie.cpp, utils.h) main.cpp ...
3
votes
0answers
299 views

C++17: Boost.Hana based compile-time plugin registration

My aim with the following is to have a way of registering a list of classes, which represent plugins. In the end, I want a boost::hana::set that contains type objects for all plugins' classes. I want ...
3
votes
0answers
223 views

Define a class for latitude and longitude in C++ using boost::units and spheroidal coordinates

I am trying to write a class that defines latitude and longitude in C++ using boost::units and normalized spheroidal coordinates. I want to throw an exception if ...
3
votes
0answers
119 views

Recursive directory scan using boost file system

I have written the following code for searching and recursive directory. Please review it. Can it be optimized to avoid traversing symlink and handle "abort" signal inside for loop to continue the ...
3
votes
0answers
73 views

A matrix class for objects other than numbers

I'm in the process of writing a matrix like container to store objects. Despite many existing matrix implementations, I won't do numerics. Instead I want to replace a ...
3
votes
0answers
148 views

A way to automatically reorder struct fields by their sizes in descending order

Using constexpr and preprocessor magic it is possible to cook a struct which have a minimal size between all possible sizes, keeping all the data members properly ...
3
votes
0answers
302 views

Recursively generate combinations while using Boost Coroutines

I've tried out implementing a combination generator using boost coroutines. It accepts an array of possible values and generates one array at a time for each combination. As a limitation, it only ...
3
votes
0answers
815 views

Computing intersection of 2D infinite lines

I wrote a small program to compute intersection of 2D infinite lines using Boost Geometry A line is defined by two points in Line class. The ...
3
votes
0answers
1k views

C++ UDP server for a game

I broke my server into two classes, a general server class and a client session class. I know the code isn't documented in the header, but I am more interested in the design of the server/session ...
3
votes
0answers
335 views

Frequent subgraph mining program

I'm trying to make a programme that reads graphs from a .txt file, puts them in a vector, and finally puts the frequent closed graphs in another resulting file. I'...
3
votes
0answers
356 views

Wrapping boost accumulators

Here is a namespace for wrapping boost accumulators for use in a broader code base. I love these accumulators but re-typedefing them everywhere is ugly and a pain. ...
2
votes
0answers
33 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
427 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
877 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
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
77 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
254 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
534 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
0answers
20 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 (...