Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.

2. Getting Started

2.1. Installing the library

The library consists of include files only, hence there is no installation procedure. The boost include directory must be on the include path. There are a number of include files that give different functionality:

  • lambda/lambda.hpp defines lambda expressions for different C++ operators, see Section 5.2.

  • lambda/bind.hpp defines bind functions for up to 9 arguments, see Section 5.3.

  • lambda/if.hpp defines lambda function equivalents for if statements and the conditional operator, see Section 5.6 (includes lambda.hpp).

  • lambda/loops.hpp defines lambda function equivalent for looping constructs, see Section 5.6.

  • lambda/switch.hpp defines lambda function equivalent for the switch statement, see Section 5.6.

  • lambda/construct.hpp provides tools for writing lambda expressions with constructor, destructor, new and delete invocations, see Section 5.8 (includes lambda.hpp).

  • lambda/casts.hpp provides lambda versions of different casts, as well as sizeof and typeid, see Section 5.10.1.

  • lambda/exceptions.hpp gives tools for throwing and catching exceptions within lambda functions, Section 5.7 (includes lambda.hpp).

  • lambda/algorithm.hpp and lambda/numeric.hpp (cf. standard algortihm and numeric headers) allow nested STL algorithm invocations, see Section 5.11.

Any other header files in the package are for internal use. Additionally, the library depends on two other Boost Libraries, the Tuple [tuple] and the type_traits [type_traits] libraries, and on the boost/ref.hpp header.

All definitions are placed in the namespace boost::lambda and its subnamespaces.

2.2. Conventions used in this document

In most code examples, we omit the namespace prefixes for names in the std and boost::lambda namespaces. Implicit using declarations

using namespace std;
using namespace boost::lambda;
are assumed to be in effect.