mirror of
https://github.com/boostorg/integer.git
synced 2025-06-26 12:31:40 +02:00
Compare commits
17 Commits
svn-branch
...
boost-1.40
Author | SHA1 | Date | |
---|---|---|---|
0fa7344d2b | |||
a1bf7131b3 | |||
dcdfca5f38 | |||
12e2311aa4 | |||
e6bbb33660 | |||
1b9549693a | |||
382eabdff5 | |||
3531eb1ac5 | |||
85e4d3e23d | |||
550fe9d89f | |||
19ed0e48e0 | |||
559b44c259 | |||
b162db6b72 | |||
4935afbcd4 | |||
167961aba1 | |||
7ce7ba6bfd | |||
c8cb2b24a1 |
31
CMakeLists.txt
Normal file
31
CMakeLists.txt
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# Copyright Troy D. Straszheim
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See http://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
# This file was automatically generated from the original CMakeLists.txt file
|
||||
# Add a variable to hold the headers for the library
|
||||
set (lib_headers
|
||||
integer.hpp
|
||||
integer_fwd.hpp
|
||||
integer_traits.hpp
|
||||
integer
|
||||
)
|
||||
|
||||
# Add a library target to the build system
|
||||
boost_library_project(
|
||||
integer
|
||||
# SRCDIRS
|
||||
TESTDIRS test
|
||||
HEADERS ${lib_headers}
|
||||
# DOCDIRS
|
||||
DESCRIPTION "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."
|
||||
MODULARIZED
|
||||
AUTHORS "Beman Dawes <bdawes -at- acm.org>"
|
||||
"Daryle Walker <darylew -at- hotmail.com>"
|
||||
# MAINTAINERS
|
||||
)
|
||||
|
||||
|
11
cstdint.htm
11
cstdint.htm
@ -2,7 +2,7 @@
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
|
||||
<meta name="ProgId" content="FrontPage.Editor.Document">
|
||||
<title>Header boost/cstdint.hpp</title>
|
||||
</head>
|
||||
@ -69,10 +69,13 @@ representing any value of any signed integer type.</p>
|
||||
capable of representing any value of any unsigned integer type.</p>
|
||||
<p>These types are required.</p>
|
||||
<hr>
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->19 Aug 2001<!--webbot bot="Timestamp" endspan i-checksum="14767" -->
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->06 Nov 2007<!--webbot bot="Timestamp" endspan i-checksum="15272" -->
|
||||
</p>
|
||||
<p> </p>
|
||||
<p><EFBFBD> Copyright Beman Dawes 2000</p>
|
||||
|
||||
<p>Distributed under the Boost Software License, Version 1.0. See
|
||||
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
@ -196,7 +196,7 @@ contaimination of values by the higher, unused bits.</p>
|
||||
<h2><a name="credits">Credits</a></h2>
|
||||
|
||||
<p>The author of the Boost bit mask class templates is <a
|
||||
href="../../../people/daryle_walker.html">Daryle Walker</a>.</p>
|
||||
href="http://www.boost.org/people/daryle_walker.html">Daryle Walker</a>.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
|
@ -186,7 +186,7 @@ code (and update old code as soon as possible).
|
||||
|
||||
|
||||
<p>The original version of the Boost binary logarithm class template was
|
||||
written by <a href="../../../people/daryle_walker.html">Daryle Walker</a>
|
||||
written by <a href="http://www.boost.org/people/daryle_walker.html">Daryle Walker</a>
|
||||
and then enhanced by Giovanni Bajo with support for compilers without
|
||||
partial template specialization. The current version was suggested,
|
||||
together with a reference implementation, by Vesa Karvonen. Gennaro Prota
|
||||
|
@ -106,7 +106,7 @@ class template.</p>
|
||||
<h2><a name="credits">Credits</a></h2>
|
||||
|
||||
<p>The author of the Boost compile-time extrema class templates is <a
|
||||
href="../../../people/daryle_walker.html">Daryle Walker</a>.</p>
|
||||
href="http://www.boost.org/people/daryle_walker.html">Daryle Walker</a>.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
// this is triggered with GCC, because it defines __cplusplus < 199707L
|
||||
# define BOOST_NO_INT64_T
|
||||
# endif
|
||||
# elif defined(__FreeBSD__) || defined(__IBMCPP__)
|
||||
# elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX)
|
||||
# include <inttypes.h>
|
||||
# else
|
||||
# include <stdint.h>
|
||||
|
@ -34,7 +34,7 @@ namespace boost
|
||||
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
|
||||
// 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char
|
||||
// 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; };
|
||||
|
@ -48,7 +48,7 @@ namespace boost {
|
||||
template <result_type n>
|
||||
struct choose_initial_n {
|
||||
|
||||
enum { c = (argument_type(1) << n << n) != 0 };
|
||||
BOOST_STATIC_CONSTANT(bool, c = (argument_type(1) << n << n) != 0);
|
||||
BOOST_STATIC_CONSTANT(
|
||||
result_type,
|
||||
value = !c*n + choose_initial_n<2*c*n>::value
|
||||
@ -85,7 +85,7 @@ namespace boost {
|
||||
template <argument_type x, result_type n = initial_n>
|
||||
struct static_log2_impl {
|
||||
|
||||
enum { c = (x >> n) > 0 }; // x >= 2**n ?
|
||||
BOOST_STATIC_CONSTANT(bool, c = (x >> n) > 0); // x >= 2**n ?
|
||||
BOOST_STATIC_CONSTANT(
|
||||
result_type,
|
||||
value = c*n + (static_log2_impl< (x>>c*n), n/2 >::value)
|
||||
|
13
index.html
13
index.html
@ -10,8 +10,8 @@
|
||||
<td bgcolor="white"><img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86"></td>
|
||||
<td><a href="../../index.htm"><font face="Arial" color="white"><big>Home</big></font></a></td>
|
||||
<td><a href="../libraries.htm"><font face="Arial" color="white"><big>Libraries</big></font></a></td>
|
||||
<td><a href="../../people/people.htm"><font face="Arial" color="white"><big>People</big></font></a></td>
|
||||
<td><a href="../../more/faq.htm"><font face="Arial" color="white"><big>FAQ</big></font></a></td>
|
||||
<td><a href="http://www.boost.org/people/people.htm"><font face="Arial" color="white"><big>People</big></font></a></td>
|
||||
<td><a href="http://www.boost.org/more/faq.htm"><font face="Arial" color="white"><big>FAQ</big></font></a></td>
|
||||
<td><a href="../../more/index.htm"><font face="Arial" color="white"><big>More</big></font></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -121,8 +121,13 @@ instead.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<p>Revised: <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %b %Y" startspan -->03 Oct 2001<!--webbot bot="Timestamp" endspan i-checksum="14373" -->
|
||||
<p>Revised: <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %b %Y" startspan -->06 Nov 2007<!--webbot bot="Timestamp" endspan i-checksum="15272" -->
|
||||
</p>
|
||||
|
||||
<p><EFBFBD> Copyright Beman Dawes 2003</p>
|
||||
|
||||
<p>Distributed under the Boost Software License, Version 1.0. See
|
||||
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
10
integer.htm
10
integer.htm
@ -193,11 +193,11 @@ href="../../boost/cstdint.hpp"><boost/cstdint.hpp></a></cite>.</p>
|
||||
<h2><a name="credits">Credits</a></h2>
|
||||
|
||||
<p>The author of most of the Boost integer type choosing templates is <a
|
||||
href="../../people/beman_dawes.html">Beman Dawes</a>. He gives thanks
|
||||
href="http://www.boost.org/people/beman_dawes.html">Beman Dawes</a>. He gives thanks
|
||||
to Valentin Bonnard and
|
||||
<a href="../../people/kevlin_henney.htm"> Kevlin Henney</a> for sharing
|
||||
<a href="http://www.boost.org/people/kevlin_henney.htm"> Kevlin Henney</a> for sharing
|
||||
their designs for similar templates. <a
|
||||
href="../../people/daryle_walker.html">Daryle Walker</a> designed the
|
||||
href="http://www.boost.org/people/daryle_walker.html">Daryle Walker</a> designed the
|
||||
value-based sized templates.</p>
|
||||
|
||||
<hr>
|
||||
@ -206,7 +206,7 @@ value-based sized templates.</p>
|
||||
|
||||
<p>© Copyright Beman Dawes 1999. Use, modification, and distribution are
|
||||
subject to the Boost Software License, Version 1.0. (See accompanying file <a
|
||||
href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or a copy at <<a
|
||||
href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or a copy at <<a
|
||||
href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>>.)</p>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -85,5 +85,10 @@ exercises the <code>integer_traits</code> class.
|
||||
Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers discussed the integer
|
||||
traits idea on the boost mailing list in August 1999.
|
||||
<hr>
|
||||
<a href="../../people/jens_maurer.htm">
|
||||
Jens Maurer</a>, 2000-02-20
|
||||
<p>Revised
|
||||
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->06 November 2007<!--webbot bot="Timestamp" endspan i-checksum="40336" --></p>
|
||||
<p><EFBFBD> Copyright Beman Dawes 2000</p>
|
||||
|
||||
<p>Distributed under the Boost Software License, Version 1.0. See
|
||||
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
|
||||
|
||||
|
1
module.cmake
Normal file
1
module.cmake
Normal file
@ -0,0 +1 @@
|
||||
boost_module(integer DEPENDS utility)
|
14
test/CMakeLists.txt
Normal file
14
test/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright Troy D. Straszheim
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See http://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
boost_additional_test_dependencies(integer BOOST_DEPENDS test)
|
||||
|
||||
boost_test_run(cstdint_test cstdint_test.cpp)
|
||||
boost_test_run(integer_mask_test integer_mask_test.cpp DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(integer_test integer_test.cpp DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(integer_traits_test integer_traits_test.cpp DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(static_log2_test static_log2_test.cpp DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(static_min_max_test static_min_max_test.cpp DEPENDS boost_test_exec_monitor)
|
20
test/Jamfile.v2
Normal file
20
test/Jamfile.v2
Normal file
@ -0,0 +1,20 @@
|
||||
#~ Copyright Rene Rivera 2008
|
||||
#~ Distributed under the Boost Software License, Version 1.0.
|
||||
#~ (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import testing ;
|
||||
|
||||
test-suite integer
|
||||
: [ run cstdint_test.cpp ]
|
||||
[ run integer_test.cpp
|
||||
/boost/test//boost_unit_test_framework ]
|
||||
[ run integer_traits_test.cpp
|
||||
/boost/test//boost_test_exec_monitor/<link>static ]
|
||||
[ run integer_mask_test.cpp
|
||||
/boost/test//boost_unit_test_framework ]
|
||||
[ run static_log2_test.cpp
|
||||
/boost/test//boost_test_exec_monitor/<link>static ]
|
||||
[ run static_min_max_test.cpp
|
||||
/boost/test//boost_test_exec_monitor/<link>static ]
|
||||
# [ compile issue_2134.cpp ]
|
||||
;
|
@ -10,8 +10,7 @@
|
||||
// Revision History
|
||||
// 23 Sep 2001 Initial version (Daryle Walker)
|
||||
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp> // for main
|
||||
#include <boost/test/minimal.hpp> // for main
|
||||
|
||||
#include <boost/cstdlib.hpp> // for boost::exit_success
|
||||
#include <boost/integer/integer_mask.hpp> // for boost::high_bit_mask_t, etc.
|
||||
|
Reference in New Issue
Block a user