Boost C++ Libraries Home Libraries People FAQ More

Next

Boost.Integer

Beman Dawes

Daryle Walker

Gennaro Prota

John Maddock

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


Table of Contents

Overview
Standard Integer Types
Integer Traits
Integer Type Selection
Integer Masks
Compile time log2 Calculation
Compile time min/max calculation
History

Boost.Integer consists of the following components:

Component

Header

Purpose

Forward Declarations.

<boost/integer_fwd.hpp>

Forward declarations of classes and class templates - for use when just the name of a class is needed.

Standard Integer Types.

<boost/cstdint.hpp>

Provides typedef's based on the 1999 C Standard header <stdint.h>, wrapped in namespace boost. This implementation may #include the compiler supplied <stdint.h>, if present.

Integer Traits.

<boost/integer_traits.hpp>

Class template boost::integer_traits, derives from std::numeric_limits and adds const_min and const_max members.

Integer Type Selection.

<boost/integer.hpp>

Templates for integer type selection based on properties such as maximum value or number of bits: Use to select the type of an integer when some property such as maximum value or number of bits is known. Useful for generic programming.

Integer Masks.

<boost/integer/integer_mask.hpp>

Templates for the selection of integer masks, single or lowest group, based on the number of bits: Use to select a particular mask when the bit position(s) are based on a compile-time variable. Useful for generic programming.

Compile time log2 Calculation.

<boost/integer/static_log2.hpp>

Template for finding the highest power of two in a number: Use to find the bit-size/range based on a maximum value. Useful for generic programming.

Compile time min/max calculation.

<boost/integer/static_min_max.hpp>

Templates for finding the extrema of two numbers: Use to find a bound based on a minimum or maximum value. Useful for generic programming.

Last revised: November 26, 2009 at 11:06:43 GMT


Next