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".
1
vote
2answers
64 views
0
votes
1answer
92 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 ...
3
votes
0answers
57 views
Http downloader using beast
I have written a small http downloader using
boost::asio
Beast library (proposed to be included in boost)
network::uri library for handling URIs
It's nowhere near completion but I would like to get ...
0
votes
0answers
42 views
Simpler Method for Casting all Numbers
I have the following code:
arbFloat pogson(){
return pow(static_cast<arbFloat>(100), static_cast<arbFloat>(1) / static_cast<arbFloat>(5));
}
...
3
votes
3answers
160 views
3
votes
1answer
93 views
Detect if string contains more than 1 period
This function returns true if the string contains zero or one periods, and returns false if the string contains more than one ...
1
vote
0answers
29 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 ...
3
votes
1answer
138 views
Boost::Asio server
This is my first time trying to do anything proper in Boost::Asio, so I would love if someone could look at it and tell me if it makes sense. It's based on examples ...
2
votes
2answers
108 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.
...
0
votes
0answers
39 views
Threadpool with abortable jobs and then
I have written a threadpool based on boost::asio where I can file jobs and receive a handle to abort jobs. When adding a job, I can (must, at the moment) provide a "...
1
vote
0answers
52 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 ...
1
vote
0answers
38 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 ...
3
votes
0answers
323 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/...
1
vote
1answer
106 views
Calculate the crc32 of the contents of a file using boost
I'm computing the crc32 of a given file using boost:
...
4
votes
1answer
106 views
Same PyObject for a shared_ptr C++ object
I have a similar problem as in this mail. I want that every time I return the same C++ managed object to Python, I get the same PyObject. With the standard ...
0
votes
2answers
166 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 ...
3
votes
0answers
95 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
1answer
233 views
Maximum clique problem: fast heuristic
I have implemented an algorithm which computes a maximum clique via a heuristic. The pseudo-code can be found in this Paper (see Algorithm 2).
Maximum Clique Problem
Given an undirected, simple ...
3
votes
0answers
160 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/...
1
vote
2answers
55 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
108 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
87 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
236 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 ...
4
votes
1answer
293 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
73 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 do ...
4
votes
0answers
147 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
147 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
160 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
65 views
Implementing bounds-checking with exceptions based on an existing bitset container
BitPat here is a wrapper around a bitset.
...
4
votes
2answers
80 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
906 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++ (\n,...
4
votes
1answer
143 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 ...
4
votes
1answer
1k 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
128 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'...
6
votes
1answer
880 views
Boost condition variable wrapper
I would like to create a wrapper for a Boost conditional variable:
...
11
votes
3answers
621 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
506 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
129 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
170 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
89 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
178 views
2
votes
1answer
66 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
351 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
355 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 ...
3
votes
1answer
2k 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
1k 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
160 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
217 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
895 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
363 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
...