boost

C++ std::sort predicate with templates

There are a couple of sorting algorithms in C++, each tailored to different use cases. As a programmer, you may or may not want to delve into the depths of sort algorithms. That’s a domain left for experts. Luckily, it’s quite easy to get started with sorting data.

visual studio 2015 boost

Building Boost 1.58 with Visual Studio 2015

If you try to build Boost 1.58 with Visual Studio 2015, you’ll get this error “Unknown compiler version - please run the configure tests and report the results” when building, do this.

boost format string examples

Boost::format string examples

Once boost::format object has been created with a format string and given arguments, there are two ways of getting a std::string (or std::wstring) from it. One is with boost::str() and the other way is with str() member method.

Asynchronous thread pool

How to stop a std::async task

Sadly, this is only an intrusive way of stopping std::async. For an almost non-intrusive way of stopping a thread, look at boost::thread.

Boost scoped_ptr vs unique_ptr

A unique_ptr is also known as std::unique_ptr. Before C++11 it was boost::unique_ptr, but became a part of STD library in C++11 and is now called std::unique_ptr.