Boost

From RogueBasin
Revision as of 16:14, 22 January 2009 by Ancient (talk | contribs) (add category)
Jump to navigation Jump to search

The Boost C++ libraries ( http://www.boost.org/ ) are licensed under the Boost License.

To a non-lawyer, the Boost License is about as permissive as a revised BSD-style license but takes up far less text. It intentionally allows reusing the source code in closed-source and commercial projects.

Boost Library features that are relatively easy to use, and remediate various issues with C++

  • Static Assertions: allows converting compile-time invariant violations into compile errors. Usage is similar to assert. This is likely to be obsoleted by a revision of the C++ language.
  • Call Traits: automatic selection of reasonably efficient types for various intentions. E.g., boost::call_traits<>::param_type selects the most efficient type for the effect of passing by value.
  • Enable/Disable If : allows conditional definition of templates. Most useful in conjunction with the STL numeric_traits template and Boost's Type Traits library, for imposing type constraints on template parameters (partially replicating C# type constraints on generic parameters)

Note that fully using the last two points require Substitution Failure Is Not An Error for templates, which does require a relatively up to date compiler.

Boost Library features that apply to C

  • Preprocessor : enables typical control structures (if-then-else, looping over the values of a list or sequence) for the C preprocessor.