From e86ce1cb1f6fa9ba93f0846de7d5d3dc2daa495d Mon Sep 17 00:00:00 2001 From: Matthew Calabrese Date: Sat, 6 Sep 2008 21:49:49 +0000 Subject: [PATCH] Changed wording for BOOST_BINARY docs. [SVN r48640] --- utility.htm | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/utility.htm b/utility.htm index a2417ef..6bc7bb4 100644 --- a/utility.htm +++ b/utility.htm @@ -187,10 +187,10 @@ void f() {

See separate documentation.

Macro BOOST_BINARY

-

The macro BOOST_BINARY allows for the +

The macro BOOST_BINARY is used for the representation of binary literals. It takes as an argument a binary number arranged as an arbitrary amount of 1s and 0s in - groupings of length 1 to 8 inclusive, with groups separated + groupings of length 1 to 8, with groups separated by spaces. The type of the literal yielded is determined by the same rules as those of hex and octal literals (2.13.1p1). By implementation, this macro @@ -201,17 +201,19 @@ void f() {

In order to directly support binary literals with suffixes, additional macros of the form BOOST_BINARY_XXX are also provided, where XXX is a standard integer suffix in all capital - letters. LL and ULL are also provided for representing long long - and unsigned long long types in compilers which provide them as - an extension.

+ letters. In addition, LL and ULL suffixes may be for representing + long long and unsigned long long types in compilers which provide + them as an extension.

-

The BOOST_BINARY family of macros reside in the header +

The BOOST_BINARY family of macros resides in the header <boost/utility/binary.hpp> which is automatically included by <boost/utility.hpp>. + href="../../boost/utility.hpp"><boost/utility.hpp> and + <boost/binary.hpp>..

Contributed by Matt Calabrese.

Example

@@ -227,11 +229,16 @@ void bar() unsigned long value2 = BOOST_BINARY_UL( 100 001 ); // unsigned long + long long value3 = BOOST_BINARY_LL( 11 000 ); // long long if supported + + assert( BOOST_BINARY( 10010 ) + & BOOST_BINARY( 11000 ) + == BOOST_BINARY( 10000 ) + ); + foo( BOOST_BINARY( 1010 ) ); // calls the first foo foo( BOOST_BINARY_LU( 1010 ) ); // calls the second foo - - long long value4 = BOOST_BINARY_LL( 11 000 ); // long long if supported }