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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
Front Page / Data Types / Numeric / long_



      long N
struct long_
    // unspecified
    // ...


An Integral Constant wrapper for long.


#include <boost/mpl/long.hpp>

Model of

Integral Constant


Parameter Requirement Description
N An integral constant A value to wrap.

Expression semantics

The semantics of an expression are defined only where they differ from, or are not defined in Integral Constant.

For arbitrary integral constant n:

Expression Semantics
long_<c> An Integral Constant x such that x::value == c and x::value_type is identical to long.


typedef long_<8> eight;

BOOST_MPL_ASSERT(( is_same< eight::value_type, long > ));
BOOST_MPL_ASSERT(( is_same< eight::type, eight > ));
BOOST_MPL_ASSERT(( is_same< next< eight >::type, long_<9> > ));
BOOST_MPL_ASSERT(( is_same< prior< eight >::type, long_<7> > ));
BOOST_MPL_ASSERT_RELATION( (eight::value), ==, 8 );
assert( eight() == 8 );

See also

Data Types, Integral Constant, int_, size_t, integral_c