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

learn more… | top users | synonyms

0
votes
1answer
19 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 ...
3
votes
0answers
43 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 ...
0
votes
0answers
31 views

Boost iterator adaptor

Consider a very large array of ints, where there are only few non-zero elements. I'm representing this array as std::map<int, int> where the first element is ...
2
votes
0answers
83 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
1answer
54 views

Thread pool using boost::thread

I would like to make a portable thread pool using boost::thread. Some one could tell me to look at boost::thread_group and ...
3
votes
1answer
61 views

Reverse Polish notation calculator similar to dc on Unix/Linux systems using dynamic libraries

This problem is using dynamic libraries so that additional calculator functions can be added by dropping a library into a specific directory. What I'd like to get out of this code review is: What ...
4
votes
0answers
75 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. ...
3
votes
1answer
51 views

Terminal ESC Sequence Decoder

The goal of this code is to read-in a stream of terminal ESC sequences, and break them down and fill a vector of parameterized sequences for processing later on. For example ...
1
vote
0answers
93 views

Alternative Boost.Any Library

Since Boost.Any library does not work well with Move-Only types, I had to write my own alternative: ...
2
votes
2answers
59 views

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

BitPat here is a wrapper around a bitset. ...
4
votes
2answers
73 views

Calculating the number of elements of an underlying data structure

I read many comments on this question that one really shouldn't use local classes for functionality like which my code provides, but I couldn't really put things into perspective and decide what ...
7
votes
1answer
528 views

Boost.Spirit UTF-8 string literal parser with escape support

I wrote (as part of a greater work) a Boost.Spirit grammar that would parse string literals, including support for the various escape sequences known from C/C++ (...
4
votes
1answer
86 views

Adding/changing ID3 tags to media files with “artist - title” format

This code puts or changes ID3 tags to media files based on their file names. It assumes the files are in this format: morbid angel - maze of torment.mp3 The ...
3
votes
1answer
683 views

Boost::pool based STL vector allocator

I wrote an STL allocator which uses boost::pool to allocate the memory for std::vector container. This is my first time I ...
3
votes
0answers
82 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. ...
5
votes
1answer
436 views

Boost condition variable wrapper

I would like to create a wrapper for a Boost conditional variable: ...
11
votes
3answers
266 views

Unit testing with a singly linked list

To hone my skills with C++11, I'm implementing a singly-linked list based on the requirements I found at this link. I've implemented code that supports the following subset of requirements from the ...
2
votes
1answer
348 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. ...
1
vote
1answer
95 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: ...
2
votes
1answer
120 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 ...
4
votes
1answer
78 views

Distance between angles as points

This code calculates the distance between angles, particularly for n-tuples of angles. One example where this situation occurs is as follows: I'm using a 2 arms, one 6 degree of freedom and the other ...
3
votes
2answers
142 views

A program to shred files

The following is a program to shred files securely: ...
2
votes
1answer
56 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, ...
8
votes
1answer
218 views

Implementation of a new kind of smart pointer in C++

I'm tempted to write a new kind of smart pointer which, I believe, is less intrusive than boost::intrusive_ptr and has the same memory footprint. The code for the ...
4
votes
3answers
233 views

Directory Snapshot

The following code creates a recursive backup of a directory in the form of interlinked HTML files, structured in the same form as the input directory. It does not take the backup of the contents ...
2
votes
1answer
1k views

Asynchronous connect() with one function call, using C++11 lambdas and Boost.Asio

I've wanted to write a C++11 class for making IPv4 TCP connections and figured that it probably could be done with just one static function using some shared_ptr and lambda "magic". The following code ...
2
votes
0answers
852 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
115 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 ...
6
votes
3answers
203 views

Code Generator Generator

I've created a code generator generator, which is hosted here. I need its parser portion reviewed for OOP, OOD, and C++ best practices. gengenparser.h ...
5
votes
2answers
717 views

Thread-safe Phoenix Singleton class template with Boost

I've implemented the phoenix-singleton as a class template with boost inspired by Modern C++ Design. The code compiles fine with MSVC 2013 - and it seems to work, but I'm new to multi-threaded ...
11
votes
2answers
327 views

Elementwise iterator adaptor

There are many C++ implementations of the Euclidean vector. I.e., a vector in what is typically a 3- or 4-dimensional space. Something along the lines of ...
7
votes
1answer
658 views

Get extension(s) from path

I'm writing an utility function that returns the extension(s) of a boost::filesystem::path (v3). Boost's path class already has some of this functionality ...
6
votes
2answers
153 views

A reversed-string Trie data structure

This is a simple Trie data structure for strings, except it puts the strings into the structure backwards. The insert method simply iterates over chars from the string-to-be-inserted backwards, and ...
3
votes
1answer
683 views

Program that handles program options

I'm using boost::program_options to parse input from the user. However, while the standard library makes this an easy task to do, it's causing an (in my opinion) ...
2
votes
0answers
139 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
1answer
270 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 Consumer ...
6
votes
1answer
334 views

Predictive recursive descent parser for math expressions

I've been learning about language theory and parsing, and decided to write my first parser: a LL(1) recursive descent parser. But actually, it does a little more than just expressions; it can also ...
1
vote
1answer
342 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 ...
7
votes
1answer
1k views

Portable C++ boost::interprocess::mutex

I was looking for long time around to have a portable robust solution for multiprocessing synchronization. Who touche this things know that good solution are boost::iterprocess named sync objects. ...
5
votes
1answer
458 views

Simple parsing for string formatting (version 2)

This is my second attempt (version 1) at writing a string formatting utility which uses parsing. This time I more explicitly designed it as a finite state machine. I have very little experience with ...
4
votes
1answer
452 views

Simple parsing for string formatting

Recently I submitted some string formatting and printing code (found here) that I wrote as an small exercise. It was implemented naively using string replacement. This time around I wanted to actually ...
10
votes
1answer
517 views

String-formatting and printing functions

As a small exercise I have written some string formatting and printing functions in C++11. I would like a bit of code review, not so much on the merits of using this over something like ...
2
votes
3answers
448 views

Boost::range::for_each + functor

I would like your comments on my code in C++ (C++98 + Boost) I have written some code to use the functors with the boost::range::for_each algorithm. My main ...
7
votes
2answers
2k views

Multiple dispatch with variant and multi visitation in C++

The following program is a demonstration of variant and double visitation used to obtain double dispatch between the elements of two inhomogeneous containers. Most of the work is done at compile time. ...
11
votes
1answer
7k views

UDP Network server/client for gaming using boost.asio

I've designed those classes for use in a multiplayer game with possibly very high number of clients for one server. Is this implementation good, or is there something obvious I overlooked or something ...
7
votes
2answers
1k views

Simple and efficient boost::unordered_set intersection

I wrote this function to do unordered_set intersection using templates. I have seen this answer but I thought that is was overkill. I would like the method to take ...
4
votes
1answer
156 views

Template with boost::operators extremely verbose and repeating

I got the following ugly code: ...
7
votes
1answer
646 views

Smart pointer memory pool

I'm using a third-party library which utilizes boost::shared_ptr for memory management. The problem is that I need to allocate many objects and I have detected ...
6
votes
1answer
139 views

Model of Arithmetic concept for usage as Opaque typedef

I have a type that models the Arithmetic concept and use it as an opaque typedef (AKA strong typedef, see Note below) in some ...
5
votes
2answers
685 views

Converting data when output std container via ostream_iterator

I have a strongly typed enum and std::vector of this type. ...