Subject Archive for Boost

How to use Boost.Program_options
Category: Programming August 2, 2012 Tags: , , , ,

If it so happens that you’re writing a console application, then chances are you will (or should) want to pass it some parameters at the command line. By default C++ has only the argc and argv parameters to the main function to facilitate this and I can assure you that working with them directly is […] read on
How Futures Aid Task Based Multithreading
Category: Programming December 8, 2010 Tags: , , , ,

Task based multithreading makes a lot of sense and is a great way to break work into manageable parcels that can be processed in parallel. A task can be conceptualised as a finite piece of work that produces a result when complete. Using a thread to carry out a task is logical, but the problem […] read on
Function pointers for thread communication
Category: Programming December 8, 2010 Tags: , , , ,

When you program with thread objects (a thread bound to a class instance) in C++ you inevitably run into the need for an effective way of extracting information from them. At this point the dilemma becomes; do you ask the thread for the information or do you get the thread to report it to you? […] read on
How to use Boost.Bind
Category: Programming December 8, 2010 Tags: , , , , ,

Function pointers are a powerful programming tool but are extremely difficult to use with only the standard C++ syntax at your disposal. Boost.Bind steps into this breach, transforming the syntax from obtuse and confusing to intuitive and accessible. This tutorial will walk you through the basics of Boost.Bind in a way that will have you […] read on
What is Boost Anyway?
Category: Programming December 8, 2010 Tags: , ,

As a C++ programmer the most important thing to know about the boost libraries is this: They will continually save you time and improve the quality of the programs that you write. It is hard to overstate the value that the boost libraries provide to a programmer, all at an attractive price point… nothing! Boost […] read on
Generating Random Numbers in C++
Category: Programming December 8, 2010 Tags: , , ,

Generating random numbers in C++ has long relied on the venerable rand() function. However times have changed (and they did so a while ago) and there is now a new random number facility that replaces rand(), this is the library Boost.Random. Boost.Random is not just another boost library, it was taken as the basis for […] read on
An Object Oriented Approach to Threading in C++
Category: Programming December 8, 2010 Tags: , , , ,

Multithreading in C++ can be a daunting topic to approach. Not only is the subject matter confusing and filled with gotchas, but it can also be hard to know how to effectively implement threads in real code and real situations. In this tutorial I will describe an object oriented approach to dealing with threads that […] read on
How to use Boost.Function
Category: Programming December 8, 2010 Tags: , , , , ,

Specifying variables of function pointer type in standard C++ has a downright filthy syntax and rightly strikes confusion into the hearts of programmers everywhere. Boost.Function provides a different syntax which is far superior in every way. This tutorial shows how to use Boost.Function with examples of common tasks and covers all of the main features […] read on