mirror of
https://github.com/boostorg/integer.git
synced 2025-07-30 20:57:13 +02:00
Add comment: int_fast_t works for unsigned too.
[SVN r9545]
This commit is contained in:
@ -23,6 +23,7 @@ namespace boost
|
|||||||
// Helper templates ------------------------------------------------------//
|
// Helper templates ------------------------------------------------------//
|
||||||
|
|
||||||
// fast integers from least integers
|
// fast integers from least integers
|
||||||
|
// int_fast_t<> works correctly for unsigned too, in spite of the name.
|
||||||
template< typename LeastInt >
|
template< typename LeastInt >
|
||||||
struct int_fast_t { typedef LeastInt fast; }; // imps may specialize
|
struct int_fast_t { typedef LeastInt fast; }; // imps may specialize
|
||||||
|
|
||||||
@ -70,6 +71,7 @@ namespace boost
|
|||||||
(Bits <= std::numeric_limits<unsigned char>::digits)
|
(Bits <= std::numeric_limits<unsigned char>::digits)
|
||||||
>::least least;
|
>::least least;
|
||||||
typedef typename int_fast_t<least>::fast fast;
|
typedef typename int_fast_t<least>::fast fast;
|
||||||
|
// int_fast_t<> works correctly for unsigned too, in spite of the name.
|
||||||
};
|
};
|
||||||
|
|
||||||
// The same dispatching technique can be used to select types based on
|
// The same dispatching technique can be used to select types based on
|
||||||
|
@ -34,6 +34,7 @@ appropriate to use the types supplied in <code><a href="../../boost/cstdint.hpp"
|
|||||||
<pre>namespace boost
|
<pre>namespace boost
|
||||||
{
|
{
|
||||||
// fast integers from least integers
|
// fast integers from least integers
|
||||||
|
// int_fast_t<> works correctly for unsigned too, in spite of the name.
|
||||||
template< typename LeastInt > // Required: LeastInt is integral type, not bool
|
template< typename LeastInt > // Required: LeastInt is integral type, not bool
|
||||||
struct int_fast_t { typedef LeastInt fast; }; // implementations may specialize
|
struct int_fast_t { typedef LeastInt fast; }; // implementations may specialize
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ appropriate to use the types supplied in <code><a href="../../boost/cstdint.hpp"
|
|||||||
{
|
{
|
||||||
typedef <i>implementation-supplied</i> least;
|
typedef <i>implementation-supplied</i> least;
|
||||||
typedef int_fast_t<least>::fast fast;
|
typedef int_fast_t<least>::fast fast;
|
||||||
|
// int_fast_t<> works correctly for unsigned too, in spite of the name.
|
||||||
};
|
};
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
</pre>
|
</pre>
|
||||||
|
Reference in New Issue
Block a user