CRC Wiki
CRC Wiki
Log in

BOOST Library

From CRC Wiki

General Description

Boost provides free peer-reviewed portable C++ source libraries. Boost emphasizes 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.

Use of high-quality libraries like Boost speeds initial development, results in fewer bugs, reduces reinvention-of-the-wheel, and cuts long-term maintenance costs. And since Boost libraries tend to become de facto or de jure standards, many programmers are already familiar with them.

Ten of the Boost libraries are included in the C++ Standard Library's TR1, and so are slated for later full standardization. More Boost libraries are in the pipeline for TR2. Using Boost libraries gives an organization a head-start in adopting new technologies.

Basic Usage

Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking.

An example of including Boost headers is shown below:

#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

int main()
{
    using namespace boost::lambda;
    typedef std::istream_iterator<int> in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );
}

Compiling BOOST Applications

Applications with BOOST routines can be compiled with the BOOST headers as follows:

g++ -I$BOOST_ROOT/include -o foo foo.cpp

Further Information

See the official website: Boost Website

Documentation for v.1.43 may be found at:

/afs/crc.nd.edu/x86_64_linux/scilib/boost/boost_1_43_0/doc/html/index.html