--- /usr/include/boost/integer_fwd.hpp	2006-04-16 14:46:07.000000000 -0400
+++ integer_fwd.hpp	2006-06-13 01:54:03.000000000 -0400
@@ -85,13 +84,13 @@
 template< int Bits >
     struct uint_t;
 
-template< long MaxValue >
+template< unsigned long MaxValue, unsigned long MaxValueUpper = 0 >
     struct int_max_value_t;
 
-template< long MinValue >
+template< long MinValue, long MaxValueUpper = 0 >
     struct int_min_value_t;
 
-template< unsigned long Value >
+template< unsigned long Value, unsigned long ValueUpper = 0 >
     struct uint_value_t;
 
 
--- /usr/include/boost/integer.hpp	2006-04-16 14:46:07.000000000 -0400
+++ integer.hpp	2006-06-13 11:45:17.000000000 -0400
@@ -7,6 +7,8 @@
 //  See http://www.boost.org/libs/integer for documentation.
 
 //  Revision History
+//   13 Jun 06  Added support for long long or __int64 (Scott McMurray)
+//              Added exact size integer templates (Scott McMurray)   
 //   22 Sep 01  Added value-based integer templates. (Daryle Walker)
 //   01 Apr 01  Modified to use new <boost/limits.hpp> header. (John Maddock)
 //   30 Jul 00  Add typename syntax fix (Jens Maurer)
@@ -23,6 +25,20 @@
 namespace boost
 {
 
+#if defined(BOOST_HAS_LONG_LONG)
+#   define BOOST_HAS_TYPE_LARGER_THAN_LONG
+    typedef long_long_type BOOST_LARGEST_INT_T;
+    typedef ulong_long_type BOOST_LARGEST_UINT_T;
+#elif defined(BOOST_HAS_MS_INT64)
+    typedef __int64 BOOST_LARGEST_INT_T;
+    typedef unsigned __int64 BOOST_LARGEST_UINT_T;
+#else
+//#   define BOOST_LARGEST_INT_T long
+//#   define BOOST_LARGEST_UINT_T unsigned long
+    typedef long BOOST_LARGEST_INT_T;
+    typedef unsigned long BOOST_LARGEST_UINT_T;
+#endif
+
   //  Helper templates  ------------------------------------------------------//
 
   //  fast integers from least integers
@@ -33,17 +49,49 @@
   //  convert category to type 
   template< int Category > struct int_least_helper {}; // default is empty
 
-  //  specializatons: 1=long, 2=int, 3=short, 4=signed char,
-  //     6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned long
-  //  no specializations for 0 and 5: requests for a type > long are in error
-  template<> struct int_least_helper<1> { typedef long least; };
-  template<> struct int_least_helper<2> { typedef int least; };
-  template<> struct int_least_helper<3> { typedef short least; };
-  template<> struct int_least_helper<4> { typedef signed char least; };
-  template<> struct int_least_helper<6> { typedef unsigned long least; };
-  template<> struct int_least_helper<7> { typedef unsigned int least; };
-  template<> struct int_least_helper<8> { typedef unsigned short least; };
-  template<> struct int_least_helper<9> { typedef unsigned char least; };
+  //  specializatons: 1=BOOST_LARGEST_INT_T, 2=long, 3=int, 4=short, 
+  //     5=signed char, 7=BOOST_LARGEST_UINT_T, 8=unsigned long, 
+  //     9=unsigned int, 10=unsigned short, 11=unsigned char
+  //  no specializations for 0 and 6: 
+  //     requests for a type > BOOST_LARGEST_INT_T are in error
+
+  template<> struct int_least_helper< 1> { typedef BOOST_LARGEST_INT_T least; };
+  template<> struct int_least_helper< 2> { typedef long least; };
+  template<> struct int_least_helper< 3> { typedef int least; };
+  template<> struct int_least_helper< 4> { typedef short least; };
+  template<> struct int_least_helper< 5> { typedef signed char least; };
+
+  template<> struct int_least_helper< 7> { typedef BOOST_LARGEST_UINT_T least; };
+  template<> struct int_least_helper< 8> { typedef unsigned long least; };
+  template<> struct int_least_helper< 9> { typedef unsigned int least; };
+  template<> struct int_least_helper<10> { typedef unsigned short least; };
+  template<> struct int_least_helper<11> { typedef unsigned char least; };
+
+  //  check that a type has the number of digits requested
+  template <typename T, int digits>
+  struct int_exact_helper {}; // default is empty
+
+  //  one specialisation for each type
+# define BOOST_INT_EXACT_HELPER_SPECIALISATION(TT) \
+  template <> \
+  struct int_exact_helper< TT, \
+                           std::numeric_limits<TT>::digits > { \
+      typedef TT exact; \
+  }
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(  signed char);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(         char);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(unsigned char);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(         short);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(unsigned short);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(         int);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(unsigned int);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(         long);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(unsigned long);
+# ifdef BOOST_HAS_TYPE_LARGER_THAN_LONG
+  BOOST_INT_EXACT_HELPER_SPECIALISATION( BOOST_LARGEST_INT_T);
+  BOOST_INT_EXACT_HELPER_SPECIALISATION(BOOST_LARGEST_UINT_T);
+# endif
+
 
   //  integer templates specifying number of bits  ---------------------------//
 
@@ -53,6 +101,7 @@
   {
       typedef typename int_least_helper
         <
+          (Bits-1 <= std::numeric_limits<BOOST_LARGEST_INT_T>::digits) +
           (Bits-1 <= std::numeric_limits<long>::digits) +
           (Bits-1 <= std::numeric_limits<int>::digits) +
           (Bits-1 <= std::numeric_limits<short>::digits) +
@@ -67,61 +116,115 @@
   {
       typedef typename int_least_helper
         < 
-          5 +
+          6 +
+          (Bits <= std::numeric_limits<BOOST_LARGEST_UINT_T>::digits) +
           (Bits <= std::numeric_limits<unsigned long>::digits) +
           (Bits <= std::numeric_limits<unsigned int>::digits) +
           (Bits <= std::numeric_limits<unsigned short>::digits) +
           (Bits <= std::numeric_limits<unsigned char>::digits)
         >::least  least;
       typedef typename int_fast_t<least>::fast  fast;
-      // int_fast_t<> works correctly for unsigned too, in spite of the name.
+  };
+
+  //  integer templates specifying an *exact* number of bits  ----------------//
+
+  //  signed
+  template< int Bits >   // bits (including sign) required
+  struct int_exact_t 
+  {
+      typedef typename int_exact_helper
+        < 
+          typename int_t<Bits>::least,
+          Bits-1
+        >::exact  exact;
+  };
+
+  //  unsigned
+  template< int Bits >   // bits required
+  struct uint_exact_t 
+  {
+      typedef typename int_exact_helper
+        < 
+          typename uint_t<Bits>::least,
+          Bits
+        >::exact  exact;
   };
 
   //  integer templates specifying extreme value  ----------------------------//
 
   //  signed
-  template< long MaxValue >   // maximum value to require support
+  // maximum value to require support
+  template< unsigned long MaxValue, unsigned long MaxValueUpper >   
   struct int_max_value_t 
   {
+      BOOST_STATIC_CONSTANT( BOOST_LARGEST_INT_T, actual_value =
+        (MaxValue + static_cast<BOOST_LARGEST_INT_T>(MaxValueUpper)
+                                                    *0x10000L*0x10000L) );
+      BOOST_STATIC_CONSTANT( bool, representable = 
+        ( actual_value/0x10000L/0x10000L ) == MaxValueUpper &&
+        ( actual_value&0xFFFFFFFFUL ) == MaxValue );
+
       typedef typename int_least_helper
         <
-          (MaxValue <= integer_traits<long>::const_max) +
-          (MaxValue <= integer_traits<int>::const_max) +
-          (MaxValue <= integer_traits<short>::const_max) +
-          (MaxValue <= integer_traits<signed char>::const_max)
+          !representable ? 6 :
+          (actual_value <= integer_traits<BOOST_LARGEST_INT_T>::const_max) +
+          (actual_value <= integer_traits<long>::const_max) +
+          (actual_value <= integer_traits<int>::const_max) +
+          (actual_value <= integer_traits<short>::const_max) +
+          (actual_value <= integer_traits<signed char>::const_max)
         >::least  least;
       typedef typename int_fast_t<least>::fast  fast;
   };
 
-  template< long MinValue >   // minimum value to require support
+  // minimum value to require support
+  template< long MinValue, long MinValueUpper >   
   struct int_min_value_t 
   {
+      BOOST_STATIC_CONSTANT( BOOST_LARGEST_INT_T, actual_value =
+//        !MinValueUpper ? MinValue :
+        (MinValue + static_cast<BOOST_LARGEST_INT_T>(MinValueUpper)
+                                                    *0x10000L*0x10000L) );
+      BOOST_STATIC_CONSTANT( bool, representable =
+//        !MinValueUpper ? actual_value == MinValue :
+        ( (actual_value-MinValue)/0x10000L/0x10000L ) == MinValueUpper &&
+        ( ( actual_value - (actual_value-MinValue) ) == MinValue ) );
       typedef typename int_least_helper
         <
-          (MinValue >= integer_traits<long>::const_min) +
-          (MinValue >= integer_traits<int>::const_min) +
-          (MinValue >= integer_traits<short>::const_min) +
-          (MinValue >= integer_traits<signed char>::const_min)
+          ( !representable || actual_value > 0 ) ? 6 :
+          (actual_value >= integer_traits<BOOST_LARGEST_INT_T>::const_min) +
+          (actual_value >= integer_traits<long>::const_min) +
+          (actual_value >= integer_traits<int>::const_min) +
+          (actual_value >= integer_traits<short>::const_min) +
+          (actual_value >= integer_traits<signed char>::const_min)
         >::least  least;
       typedef typename int_fast_t<least>::fast  fast;
   };
 
   //  unsigned
-  template< unsigned long Value >   // maximum value to require support
+  // maximum value to require support
+  template< unsigned long Value, unsigned long ValueUpper >   
   struct uint_value_t 
   {
+      BOOST_STATIC_CONSTANT( BOOST_LARGEST_UINT_T, actual_value =
+        (Value + static_cast<BOOST_LARGEST_UINT_T>(ValueUpper)
+                                                    *0x10000L*0x10000L) );
+      BOOST_STATIC_CONSTANT( bool, representable = 
+        ( actual_value/0x10000L/0x10000L ) == ValueUpper &&
+        ( actual_value&0xFFFFFFFFUL ) == Value );
+
       typedef typename int_least_helper
         < 
-          5 +
-          (Value <= integer_traits<unsigned long>::const_max) +
-          (Value <= integer_traits<unsigned int>::const_max) +
-          (Value <= integer_traits<unsigned short>::const_max) +
-          (Value <= integer_traits<unsigned char>::const_max)
+          !representable ? 0 :
+          6 +
+          (actual_value <= integer_traits<BOOST_LARGEST_UINT_T>::const_max) +
+          (actual_value <= integer_traits<unsigned long>::const_max) +
+          (actual_value <= integer_traits<unsigned int>::const_max) +
+          (actual_value <= integer_traits<unsigned short>::const_max) +
+          (actual_value <= integer_traits<unsigned char>::const_max)
         >::least  least;
       typedef typename int_fast_t<least>::fast  fast;
   };
 
-
 } // namespace boost
 
 #endif  // BOOST_INTEGER_HPP
--- integer.htm_original	2004-10-05 11:45:23.000000000 -0400
+++ integer.htm	2006-06-13 11:54:55.000000000 -0400
@@ -58,14 +58,28 @@
   };
 
   //  signed
-  template&lt; long MaxValue &gt;
+  template&lt; int Bits &gt;
+  struct int_exact_t 
+  {
+      typedef <em>implementation_supplied</em>  exact;
+  };
+
+  //  unsigned
+  template&lt; int Bits &gt;
+  struct uint_exact_t 
+  {
+      typedef <em>implementation_supplied</em>  exact;
+  };
+
+  //  signed
+  template&lt; unsigned long MaxValue, unsigned long MaxValueUpper = 0 &gt;
   struct int_max_value_t 
   {
       typedef <em>implementation_supplied</em>  least;
       typedef int_fast_t&lt;least&gt;::fast  fast;
   };
 
-  template&lt; long MinValue &gt;
+  template&lt; long MinValue, long MinValueUpper = 0 &gt;
   struct int_min_value_t 
   {
       typedef <em>implementation_supplied</em>  least;
@@ -73,12 +87,13 @@
   };
 
   //  unsigned
-  template&lt; unsigned long Value &gt;
+  template&lt; unsigned long Value, unsigned long ValueUpper = 0 &gt;
   struct uint_value_t 
   {
       typedef <em>implementation_supplied</em>  least;
       typedef int_fast_t&lt;least&gt;::fast  fast;
   };
+
 } // namespace boost
 </pre></blockquote>
 
@@ -105,8 +120,9 @@
 <h2><a name="sized">Sized Types</a></h2>
 
 <p>The <code>int_t</code>, <code>uint_t</code>,
-<code>int_max_value_t</code>, <code>int_min_value_t</code>, and
-<code>uint_value_t</code> class templates find the most appropiate
+<code>int_max_value_t</code>, <code>int_min_value_t</code>, 
+<code>uint_value_t</code>, <code>int_exact_t</code>, and 
+<code>uint_exact_t</code> class templates find the most appropiate
 built-in integral type for the given template parameter.  This type is
 given by the class member <code>least</code>.  The easiest-to-manipulate
 version of that type is given by the class member <code>fast</code>. 
@@ -123,34 +139,74 @@
 		<td>The smallest built-in signed integral type with at least the
 			given number of bits, including the sign bit.  The parameter
 			should be a positive number.  A compile-time error results if
-			the parameter is larger than the number of bits in a
-			<code>long</code>.</td>
+			the parameter is larger than the number of bits in the largest
+			available integral type (<code>long long</code> or 
+			<code>__int64</code> if supported, otherwise
+			<code>long</code>).</td>
 	</tr>
 	<tr>
 		<td><code>boost::uint_t</code></td>
 		<td>The smallest built-in unsigned integral type with at least
 			the given number of bits.  The parameter should be a positive
 			number.  A compile-time error results if the parameter is
-			larger than the number of bits in an <code>unsigned
-			long</code>.</td>
+			larger than the number of bits in the largest
+			available integral type (<code>unsigned long long</code> or 
+			<code>unsigned __int64</code> if supported, otherwise
+			<code>unsigned long</code>).</td>
+	</tr>
+	<tr>
+		<td><code>boost::int_exact_t</code></td>
+		<td>The built-in signed integral type with <em>exactly</em> the
+			given number of bits, including the sign bit.  The parameter
+			should be a positive number.  A compile-time error results if
+			no such type is supported.  <code>long long</code> and 
+			<code>__int64</code> are considered if supported.<br />
+			Note that the type's name is <code>exact</code>, not
+			<code>least</code>, and that no <code>fast</code> is provided.<br />
+			Generally <code>int_t</code> should be preferred to
+			<code>int_exact_t</code> unless you <em>really</em> need
+			<em>exactly</em> a certain size.</td>
+	</tr>
+	<tr>
+		<td><code>boost::uint_exact_t</code></td>
+		<td>The smallest built-in unsigned integral type with <em>exactly</em>
+			the given number of bits.  The parameter should be a positive
+			number.  A compile-time error results if 
+			no such type is supported.  <code>unsigned long long</code> and 
+			<code>unsigned __int64</code> are considered if supported.<br />
+			Note that the type's name is <code>exact</code>, not
+			<code>least</code>, and that no <code>fast</code> is provided.<br />
+			Generally <code>uint_t</code> should be preferred to
+			<code>uint_exact_t</code> unless you <em>really</em> need
+			<em>exactly</em> a certain size.</td>
 	</tr>
 	<tr>
 		<td><code>boost::int_max_value_t</code></td>
 		<td>The smallest built-in signed integral type that supports the
 			given value as a maximum.  The parameter should be a
-			positive number.</td>
+			positive number.<br />
+		    For numbers above 0xFFFFFFFF, use the second template parameter
+		    to set bits 32-63.  For example, if you wish 0x1234567890, use
+		    <code>boost::uint_value_t&lt;0x34567890,0x12&gt;::least</code>.</td>	
 	</tr>
 	<tr>
 		<td><code>boost::int_min_value_t</code></td>
 		<td>The smallest built-in signed integral type that supports the
 			given value as a minimum.  The parameter should be a
-			negative number.</td>
+			negative number.<br />
+		    For numbers below -0x80000000, use the second template parameter
+		    to set bits 32-63.  For example, if you wish -0x1234567890, use
+		    <code>boost::uint_value_t&lt;-0x34567890,-0x12&gt;::least</code>.
+		    </td>	
 	</tr>
 	<tr>
 		<td><code>boost::uint_value_t</code></td>
 		<td>The smallest built-in unsigned integral type that supports
 			the given value as a maximum.  The parameter should be a
-			positive number.</td>
+			positive number.<br />
+		    For numbers above 0xFFFFFFFF, use the second template parameter
+		    to set bits 32-63.  For example, if you wish 0x1234567890, use
+		    <code>boost::uint_value_t&lt;0x34567890,0x12&gt;::least</code>.</td>	
 	</tr>
 </table>
 
@@ -163,6 +219,14 @@
 int main()
 {
     boost::int_t&lt;24&gt;::least my_var;
+    BOOST_STATIC_ASSERT( sizeof(my_var)*CHAR_BIT >= 24 );
+
+    boost::uint_exact_t&lt;32&gt;::least my_32_bit_var;
+    BOOST_STATIC_ASSERT( sizeof(my_32_bit_var)*CHAR_BIT == 32 );
+
+    // Can store at least 257 distinct values
+    typedef boost::uint_value_t&lt;256&gt;::least my_stream_int_type;
+    
     //...
 }
 </pre></blockquote>













