Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost Library [closed]

Tags:

c++

boost

Since I have started using this site, I keep hearing about the Boost library. I am wondering what are some of the major benefits of the Boost library (hence why should I use it) and how portable is the Boost library?

like image 440
Matt Pascoe Avatar asked Sep 29 '08 15:09

Matt Pascoe


People also ask

Are boost libraries free?

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.

How do I link my boost library to code blocks?

Include Boost headers and link with Boost librarieshpp> in your source file. In your project's build options, highlight the root of your project, select the "Linker settings" tab, and add "boost_*-mgwXX-mt-1_47" to your Link libraries.

Is boost open source?

Boost is licensed under its own free, open-source license, known as the Boost Software License.


2 Answers

Boost is organized by several members of the standard committee.
So it is a breeding ground for libraries that will be in the next standard.

  1. It is an extension to the STL (it fills in the bits left out)
  2. It is well documented.
  3. It is well peer-reviewed.
  4. It has high activity so bugs are found and fixed quickly.
  5. It is platform neutral and works everywhere.
  6. It is free to use.

With tr1 coming up soon it is nice to know that boost already has a lot of the ground covered. A lot of the libraries in tr1 are basically adapted directly from boost originals and thus have been tried and tested. The difference is that they have been moved into the std::tr1 namespace (rather than boost).

All that you need to do is add the following to your compilers default include search path:

<boost-install-path>/boost/tr1/tr1 

Then when you include the standard headers boost will automatically import all the required stuff into the namespace std::tr1

For Example:

To use std::tr1::share_ptr you just need to include <memory>. This will give you all the smart pointers with one file.

like image 121
Martin York Avatar answered Sep 19 '22 00:09

Martin York


You can simply read the Boost Background Information page to get a quick overview of why you should use Boost and what you can use it for. Worth the few minutes it takes.

like image 21
Mihai Limbășan Avatar answered Sep 17 '22 00:09

Mihai Limbășan