Practical examples of using Boost serialization

TweetListing1: Serialization of STL containers: a std::vector example using text archives Your intuition may tell you to iterate through the STL container in order to serialize it, but it’s actually a lot simpler. First of all, be sure to include … Continue reading


Using BoostPro to install Boost library packages

TweetA number of Windows-based Boost libraries are not “header-only” and require that you must get them compiled. One way is to compile them yourself. A possibly easier way is to do this via the prebuilt installer packages from BoostPro. Say … Continue reading


Using boost::bind to assign functions

TweetSome code samples I have collated in the sample below, that demonstrate how boost::function can be assigned with functors, ordinary functions, class member functions and overloaded class member functions respectively. #include <iostream> #include <boost/function.hpp> #include <boost/bind.hpp> using namespace std; // … Continue reading


Getting started with the Boost libraries in Cygwin

TweetThis post assumes that the boost libraries have been downloaded and extracted to the directory of your choice. See this previous posting for more details on how to download and extract the Boost libraries. Open Cygwin and cd to the … Continue reading


Using boost::bind as an improved means of calling member functions

TweetThis post takes a look at using boost::bind as a means of calling class member functions in an efficient and generic way. It basically summarizes what has already been said at Björn Karlsson’s excellent Informit article. Since I found the … Continue reading


Getting started with the Boost libraries in Ubuntu Linux

Tweet1. Install the Boost libraries from the command line First try the following $ sudo apt-get install libboost* You may get an error message similar to the following, like I did: E: Unable to correct problems, you have held broken … Continue reading


A First Stab at boost::bind

TweetBoost::bind is “able to bind any argument to a specific value or route input arguments into arbitrary positions.” It’s a means of converting a function into an object that can be copied around and called at a later point, deferred … Continue reading


Avoiding Memory Leaks using Boost Libraries

TweetUsing boost::scoped_array When we want to dynamically allocate an array of objects for some purpose, the C++ programming language offers us the new and delete operators that are intended to replace the traditional malloc() and free() subroutines that are part … Continue reading


Getting Started with Boost Threads in Visual Studio

TweetIntroduction This post aims to be an accessible introduction to getting set up with the Boost threads in Visual Studio environments for the first time.  Like with many technical subjects, there is a great deal of information out on the … Continue reading


Using Smart Pointers to Avoid Memory Leaks

TweetUsing boost::scoped_array When we want to dynamically allocate an array of objects for some purpose, the C++ programming language offers us the new and delete operators that are intended to replace the traditional malloc() and free() subroutines that are part … Continue reading


How to Install the Boost Libraries in Visual Studio

Tweet1.Download and install boost from here or here. 2. Right-click on the project listed in the solution explorer and select properties: 3. In configuration properties – C/C++ – Additional Include Directories, enter the path to wherever you have installed the … Continue reading


Finding Minimal Spanning Trees using Kruskal’s Algorithm in MFC / C++ / Boost libraries

TweetKruskal’s algorithm is used to find the minimal spanning tree for a network with a set of weighted links. This might be a telecoms network, or the layout for planning pipes and cables, or one of many other applications. It … Continue reading