What is Boost?

Learn about

C++ boost libraries are widely useful library. This is used for different sections. It has large domain of applications. Let's see an example:

Big Integer in C++ and Boost

We can use big integer datatype. We can use different datatypes like int128_t, int256_t, int1024_t etc. By using this we can get precision up to 1024 easily.

C++ (GCC 9.2.0)
  • Input  

Boost is a large collection of high-quality libraries intended for use in C++. They are free and cover a large variety of categories. Boost is often considered a "second standard library", and many C++ problems are resolved by using Boost. Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial Boost covers every corner of programming, and continues to be improved and expanded.

It includes libraries for:

  • String and text processing
  • Containers
  • Iterators
  • Algorithms
  • Function objects and higher-order programming
  • Generic Programming
  • Template Metaprogramming
  • Preprocessor Metaprogramming
  • Concurrent Programming
  • Math and numerics
  • Correctness and testing
  • Data structures
  • Image processing
  • Input/Output
  • Inter-language support
  • Memory
  • Parsing
  • Programming Interfaces
  • Miscellaneous
  • Broken compiler workarounds

The best part about Boost is that most of its libraries are header-only, so there's nothing to compile or link to. Simply download it, extract it into your favorite directory, tell your compiler where to find it, and use it!

However, there are some libraries that need to be compiled. These libraries are generally more heavy-weight, and/or rely heavily on platform-specific functionality. The libraries that need to be compiled are:

  • Date Time
  • Filesystem
  • Graph
  • Iostreams
  • Math/Special Functions*
  • MPI
  • Program options
  • Regular Expressions
  • Serialization
  • Signals
  • System
  • Test
  • Thread
  • Wave

Boost provides instructions on how to do this, and the process is mostly automated. Once built, most libraries will be automatically linked, if possible.

C++ Scientific Programming