BoostPro Computing

BoostCon 2008

Template Metaprogramming

Template Metaprogramming allows the construction of libraries that "think they're compilers," [1] i.e. libraries that generate code. That in turn enables users to code in terms of declarative specification rather than by cobbling together general-purpose procedural elements. Think of it as a power tool that a library writer can use to raise the level of abstraction he provides.

Boost.MPL is a framework of compile-time algorithms, sequences and metafunctions that brings the practical application of C++ template metaprogramming within reach of programmers in the real world. By combining higher-order abstractions, analogies to familiar STL concepts, and workarounds for the most problematic compilers, developers are able to directly express their intention rather than thinking about the low-level details of the C++ template system. The MPL has been extensively stress-tested in the implementations of other existing Boost libraries, and has been tuned for compile-time performance and ability to handle large metaprograms.

For example:

Spirit is a flexible parser generation framework in which the grammars themselves are written in pure C++. By approximating Extended Backus-Normal Form (EBNF) with C++ operators, Spirit demolishes the barrier found in most parsing systems between the grammar and semantic actions, making it simple to add small, lightweight parsers to any program. Combined with a modular design, the use of advanced template metaprogramming, and infinite lookahead, Spirit scales smoothly to handle the most-difficult parsing problems. Since the parser compiles directly to machine code without lookup tables or driver programs, the result is amazingly tight and fast. Unlike traditional parser generators, Spirit doesn't stop with parsing and semantic actions: it also gives you a suite of built-in grammars for common patterns, and associated parsing tools such as symbol tables and AST generators.
[1]Todd Veldhuizen, Blitz++: The library that thinks it is a compiler (SciTools 98)

News

  • BoostPro Installer 1.36.0 Released

    Boost 1.36.0 includes 4 new libraries (Boost.Accumulators, Boost.Exception, Boost.Units, and Boost.Unordered) and many updates. Download our free installer today.

    More...

  • Changing Our Name

    Boost Consulting, Inc. to become BoostPro Computing.

    More...

  • BoostCon 2008: Early Reg. Deadline

    Early registration for BoostCon'08, the 2nd annual Boost Conference, closes on April 1. Register now to qualify for the “early bird” discount.

    More...