Book Image

Learning Boost C++ Libraries

By : Arindam Mukherjee
Book Image

Learning Boost C++ Libraries

By: Arindam Mukherjee

Overview of this book

Table of Contents (19 chapters)
Learning Boost C++ Libraries
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

What is Boost?


Boost is a collection of free, peer-reviewed, portable, open source libraries in C++. Over the last decade and a half, there have been, as of this writing, 57 releases of the Boost libraries. In this span, Boost has released libraries of compelling usefulness that promote correct, portable, efficient, and readable C++ code. A number of prominent Standards Committee members are also the most active participants in Boost and subsequent directions of C++ standardization have been heavily influenced by the work done at Boost. Boost has provided the Standards Committee with the laboratory they need to perfect their ideas for the best new features that C++ should have. Several Boost libraries were included in the Technical Report 1 of the C++ Standards Committee, which considerably enhanced the functionality defined in the C++ 2003 revised standard; these included both language and library features. Most of these libraries made it to the C++11 Standard published in 2011. A couple more library features that originated in Boost have been added to the latest revision of the C++ Standard known as C++14 (published in 2014).

Over the years, Boost has added libraries for string and text processing, including regular expression handling, generic containers compatible with the Standard Library, smart pointers for efficient exception-safe memory management, concurrent programming, network programming, interprocess communication, filesystem handling, template metaprogramming, and many others. The following table lists some of the prominent Boost libraries grouped by category. This is by no means exhaustive:

Category

Libraries

Memory management

Smart Ptr, Align, Pool

Data structures

Container, Array, Multi-Index, Bimap, Pointer Container, Optional, Variant, Any, Tuple, Assign

Algorithms

Algorithm, Range

String and text

Conversion, String Algo, Regex, Tokenizer, Spirit, Xpressive

Systems programming

System, Filesystem, Chrono, Date Time, Thread, Asio, Interprocess

I/O

IOStreams, Locale, Serialization, Format

Higher-order programming

Function, Bind, Phoenix, Signals2

Generic programming

Enable If, Type Traits, MPL, Fusion, Proto

Language features emulation

Foreach, Move, Exception, Parameter

Correctness and testing

Test, Static Assert

Miscellaneous

Utility, Log, Uuid, Program Options, CRC

Boost libraries have found varied use in the industry because of some very high-performance libraries (such as Boost.Asio and Boost.Intrusive), and because of a very permissive and uncomplicated Boost license, which allows source redistribution, distribution of derivative work, and distribution in a binary form for noncommercial as well as commercial purposes with minimal constraints. In the next section, we will set up a development environment that enables us to use any Boost library in our C++ code using consistent conventions. This should serve us well for the rest of the book.