commit e5d8b8eb00b53370c56d2377439b9e5ca2b15725 Author: nobody Date: Wed Feb 28 21:39:58 2001 +0000 This commit was manufactured by cvs2svn to create branch 'unlabeled-1.4.2'. [SVN r9366] diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e84d7c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,96 @@ +* text=auto !eol svneol=native#text/plain +*.gitattributes text svneol=native#text/plain + +# Scriptish formats +*.bat text svneol=native#text/plain +*.bsh text svneol=native#text/x-beanshell +*.cgi text svneol=native#text/plain +*.cmd text svneol=native#text/plain +*.js text svneol=native#text/javascript +*.php text svneol=native#text/x-php +*.pl text svneol=native#text/x-perl +*.pm text svneol=native#text/x-perl +*.py text svneol=native#text/x-python +*.sh eol=lf svneol=LF#text/x-sh +configure eol=lf svneol=LF#text/x-sh + +# Image formats +*.bmp binary svneol=unset#image/bmp +*.gif binary svneol=unset#image/gif +*.ico binary svneol=unset#image/ico +*.jpeg binary svneol=unset#image/jpeg +*.jpg binary svneol=unset#image/jpeg +*.png binary svneol=unset#image/png +*.tif binary svneol=unset#image/tiff +*.tiff binary svneol=unset#image/tiff +*.svg text svneol=native#image/svg%2Bxml + +# Data formats +*.pdf binary svneol=unset#application/pdf +*.avi binary svneol=unset#video/avi +*.doc binary svneol=unset#application/msword +*.dsp text svneol=crlf#text/plain +*.dsw text svneol=crlf#text/plain +*.eps binary svneol=unset#application/postscript +*.gz binary svneol=unset#application/gzip +*.mov binary svneol=unset#video/quicktime +*.mp3 binary svneol=unset#audio/mpeg +*.ppt binary svneol=unset#application/vnd.ms-powerpoint +*.ps binary svneol=unset#application/postscript +*.psd binary svneol=unset#application/photoshop +*.rdf binary svneol=unset#text/rdf +*.rss text svneol=unset#text/xml +*.rtf binary svneol=unset#text/rtf +*.sln text svneol=native#text/plain +*.swf binary svneol=unset#application/x-shockwave-flash +*.tgz binary svneol=unset#application/gzip +*.vcproj text svneol=native#text/xml +*.vcxproj text svneol=native#text/xml +*.vsprops text svneol=native#text/xml +*.wav binary svneol=unset#audio/wav +*.xls binary svneol=unset#application/vnd.ms-excel +*.zip binary svneol=unset#application/zip + +# Text formats +.htaccess text svneol=native#text/plain +*.bbk text svneol=native#text/xml +*.cmake text svneol=native#text/plain +*.css text svneol=native#text/css +*.dtd text svneol=native#text/xml +*.htm text svneol=native#text/html +*.html text svneol=native#text/html +*.ini text svneol=native#text/plain +*.log text svneol=native#text/plain +*.mak text svneol=native#text/plain +*.qbk text svneol=native#text/plain +*.rst text svneol=native#text/plain +*.sql text svneol=native#text/x-sql +*.txt text svneol=native#text/plain +*.xhtml text svneol=native#text/xhtml%2Bxml +*.xml text svneol=native#text/xml +*.xsd text svneol=native#text/xml +*.xsl text svneol=native#text/xml +*.xslt text svneol=native#text/xml +*.xul text svneol=native#text/xul +*.yml text svneol=native#text/plain +boost-no-inspect text svneol=native#text/plain +CHANGES text svneol=native#text/plain +COPYING text svneol=native#text/plain +INSTALL text svneol=native#text/plain +Jamfile text svneol=native#text/plain +Jamroot text svneol=native#text/plain +Jamfile.v2 text svneol=native#text/plain +Jamrules text svneol=native#text/plain +Makefile* text svneol=native#text/plain +README text svneol=native#text/plain +TODO text svneol=native#text/plain + +# Code formats +*.c text svneol=native#text/plain +*.cpp text svneol=native#text/plain +*.h text svneol=native#text/plain +*.hpp text svneol=native#text/plain +*.ipp text svneol=native#text/plain +*.tpp text svneol=native#text/plain +*.jam text svneol=native#text/plain +*.java text svneol=native#text/plain diff --git a/include/boost/integer.hpp b/include/boost/integer.hpp new file mode 100644 index 0000000..a5ef737 --- /dev/null +++ b/include/boost/integer.hpp @@ -0,0 +1,81 @@ +// boost integer.hpp header file -------------------------------------------// + +// (C) Copyright Beman Dawes 1999. Permission to copy, use, modify, sell +// and distribute this software is granted provided this copyright +// notice appears in all copies. This software is provided "as is" without +// express or implied warranty, and with no claim as to its suitability for +// any purpose. + +// See http://www.boost.org for most recent version including documentation. + +// Revision History +// 30 Jul 00 Add typename syntax fix (Jens Maurer) +// 28 Aug 99 Initial version + +#ifndef BOOST_INTEGER_HPP +#define BOOST_INTEGER_HPP + +#include + +namespace boost +{ + + // Helper templates ------------------------------------------------------// + + // fast integers from least integers + template< typename LeastInt > + struct int_fast_t { typedef LeastInt fast; }; // imps may specialize + + // 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 + 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; }; + + // integer templates specifying number of bits ---------------------------// + + // signed + template< int Bits > // bits (including sign) required + struct int_t + { + typedef typename int_least_helper + < + (Bits-1 <= std::numeric_limits::digits) + + (Bits-1 <= std::numeric_limits::digits) + + (Bits-1 <= std::numeric_limits::digits) + + (Bits-1 <= std::numeric_limits::digits) + >::least least; + typedef typename int_fast_t::fast fast; + }; + + // unsigned + template< int Bits > // bits required + struct uint_t + { + typedef typename int_least_helper + < + 5 + + (Bits <= std::numeric_limits::digits) + + (Bits <= std::numeric_limits::digits) + + (Bits <= std::numeric_limits::digits) + + (Bits <= std::numeric_limits::digits) + >::least least; + typedef typename int_fast_t::fast fast; + }; + +// The same dispatching technique can be used to select types based on +// values. That will be added once boost::integer_traits is available. + + +} // namespace boost + +#endif // BOOST_INTEGER_HPP + diff --git a/index.htm b/index.htm new file mode 100644 index 0000000..8b3ffed --- /dev/null +++ b/index.htm @@ -0,0 +1,98 @@ + + + + + + + +Boost Integer Library + + + + + + + + + + + + + +
c++boost.gif (8819 bytes)Home Libraries People FAQ More
+ +

Boost Integer Library

+ + + + + + + + + + + + + + + + + + + + + + +
Header / DocsContentsUse
<boost/cstdint.hpp>
+

+ documentation
+
Typedef's based on the 1999 C Standard header <stdint.h>, wrapped in namespace boost. + This implementation may #include the compiler + supplied <stdint.h>, if present. Supplies typedefs for standard integer types such as int32_t or uint_least16_t. + Use in preference to <stdint.h> + for enhanced portability. Furthermore, all names are safely placed in the boost namespace.
<boost/integer_traits.hpp>
+
+ documentation +
Template class boost::integer_traits, derived from std::numeric_limits.  + Adds const_min and const_max members.Use to obtain the characteristics of a known integer type.
<boost/integer.hpp>
+
+
documentation
Templates for integer type selection based on properties such as + maximum value or number of bits.Use to select the type an integer when some property such as maximum value or number of bits is known. + Useful for generic programming.
+ +

Rationale

+

The organization of boost integer headers and classes is designed to take +advantage of <stdint.h> types from the 1999 C standard +without resorting to undefined behavior in terms of +the 1998 C++ standard.  The header <boost/cstdint.hpp> +makes the standard integer types safely available in namespace boost without placing any names in namespace std. As always, the intension is to complement rather than +compete with the C++ Standard Library.  Should some future C++ standard +include <stdint.h> and <cstdint>, then <boost/cstdint.hpp> +will continue to function, but will become redundant and may be safely deprecated.

+

Because these are boost headers, their names conform to boost header naming +conventions rather than C++ Standard Library header naming conventions. + +

Caveat emptor

+

As an + implementation artifact, certain C <limits.h> macro names may possibly be +visible to users of <boost/cstdint.hpp>.  Don't use these macros; they are not part of +any Boost specified interface.  + Use boost:: integer_traits<> or std::numeric_limits<> instead.

+ +

+As another implementation artifact, certain C +<stdint.h> typedef names may possibly be visible in the +global namespace to users of <boost/cstdint.hpp>. +Don't use these names, they are not part of any Boost specified +interface. Use the respective names in namespace boost +instead. + +


+ +

Revised: 14 Nov 2000 +

+ + + +