mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Changed wording for BOOST_BINARY docs.
[SVN r48640]
This commit is contained in:
parent
f15c96ffb0
commit
e86ce1cb1f
25
utility.htm
25
utility.htm
@ -187,10 +187,10 @@ void f() {
|
|||||||
<p>See <a href="base_from_member.html">separate documentation</a>.</p>
|
<p>See <a href="base_from_member.html">separate documentation</a>.</p>
|
||||||
<h2><a name="BOOST_BINARY">Macro BOOST_BINARY</a></h2>
|
<h2><a name="BOOST_BINARY">Macro BOOST_BINARY</a></h2>
|
||||||
|
|
||||||
<p>The macro <code>BOOST_BINARY</code> allows for the
|
<p>The macro <code>BOOST_BINARY</code> is used for the
|
||||||
representation of binary literals. It takes as an argument
|
representation of binary literals. It takes as an argument
|
||||||
a binary number arranged as an arbitrary amount of 1s and 0s in
|
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
|
by spaces. The type of the literal yielded is determined by
|
||||||
the same rules as those of hex and octal
|
the same rules as those of hex and octal
|
||||||
literals (<i>2.13.1p1</i>). By implementation, this macro
|
literals (<i>2.13.1p1</i>). By implementation, this macro
|
||||||
@ -201,17 +201,19 @@ void f() {
|
|||||||
<p>In order to directly support binary literals with suffixes,
|
<p>In order to directly support binary literals with suffixes,
|
||||||
additional macros of the form BOOST_BINARY_XXX are also
|
additional macros of the form BOOST_BINARY_XXX are also
|
||||||
provided, where XXX is a standard integer suffix in all capital
|
provided, where XXX is a standard integer suffix in all capital
|
||||||
letters. LL and ULL are also provided for representing long long
|
letters. In addition, LL and ULL suffixes may be for representing
|
||||||
and unsigned long long types in compilers which provide them as
|
long long and unsigned long long types in compilers which provide
|
||||||
an extension.</p>
|
them as an extension.</p>
|
||||||
|
|
||||||
|
|
||||||
<p>The BOOST_BINARY family of macros reside in the header
|
<p>The BOOST_BINARY family of macros resides in the header
|
||||||
<a
|
<a
|
||||||
href="../../boost/utility/binary.hpp"><boost/utility/binary.hpp></a>
|
href="../../boost/utility/binary.hpp"><boost/utility/binary.hpp></a>
|
||||||
which is automatically included by
|
which is automatically included by
|
||||||
<a
|
<a
|
||||||
href="../../boost/utility.hpp"><boost/utility.hpp></a>.
|
href="../../boost/utility.hpp"><boost/utility.hpp></a> and
|
||||||
|
<a
|
||||||
|
href="../../boost/binary.hpp"><boost/binary.hpp></a>..
|
||||||
|
|
||||||
<p>Contributed by Matt Calabrese.</p><p>
|
<p>Contributed by Matt Calabrese.</p><p>
|
||||||
</p><h3>Example</h3>
|
</p><h3>Example</h3>
|
||||||
@ -227,11 +229,16 @@ void bar()
|
|||||||
|
|
||||||
unsigned long value2 = BOOST_BINARY_UL( 100 001 ); // unsigned long
|
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( 1010 ) ); // calls the first foo
|
||||||
|
|
||||||
foo( BOOST_BINARY_LU( 1010 ) ); // calls the second foo
|
foo( BOOST_BINARY_LU( 1010 ) ); // calls the second foo
|
||||||
|
|
||||||
long long value4 = BOOST_BINARY_LL( 11 000 ); // long long if supported
|
|
||||||
}
|
}
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
<hr>
|
<hr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user