Compare commits

..

2 Commits

Author SHA1 Message Date
7d500a2723 This commit was manufactured by cvs2svn to create tag
'Version_1_27_0'.

[SVN r12749]
2002-02-07 13:33:59 +00:00
73b925e479 This commit was manufactured by cvs2svn to create branch 'RC_1_27_0'.
[SVN r12739]
2002-02-06 03:32:50 +00:00
6 changed files with 14 additions and 75 deletions

View File

@ -99,8 +99,8 @@ void integral_constant_type_check(T1, T2)
// numeric_limits implementations currently
// vary too much, or are incomplete or missing.
//
T1 t1 = static_cast<T1>(-1); // cast suppresses warnings
T2 t2 = static_cast<T2>(-1); // ditto
T1 t1 = -1;
T2 t2 = -1;
#if defined(BOOST_HAS_STDINT_H)
// if we have a native stdint.h
// then the INTXX_C macros may define
@ -110,10 +110,10 @@ void integral_constant_type_check(T1, T2)
assert(sizeof(T1) == sizeof(T2));
assert(t1 == t2);
#endif
if(t1 > 0)
assert(t2 > 0);
if(t1 >= 0)
assert(t2 >= 0);
else
assert(!(t2 > 0));
assert(t2 < 0);
}

View File

@ -107,12 +107,11 @@ at compile-time) available.</p>
<h2><a name="credits">Credits</a></h2>
<p>The author of the Boost binary logarithm class template is <a
href="../../../people/daryle_walker.html">Daryle Walker</a>. Giovanni Bajo
added support for compilers without partial template specialization.</p>
href="../../../people/daryle_walker.html">Daryle Walker</a>.</p>
<hr>
<p>Revised May 14, 2002</p>
<p>Revised October 1, 2001</p>
<p>&copy; Copyright Daryle Walker 2001. Permission to copy, use,
modify, sell and distribute this document is granted provided this

View File

@ -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="../../../../people/daryle_walker.html">Daryle Walker</a>.</p>
<hr>

View File

@ -228,9 +228,9 @@ namespace boost
# else
# error defaults not correct; you must hand modify boost/cstdint.hpp
# endif
# elif defined(BOOST_HAS_MS_INT64)
# elif (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520))
//
// we have Borland/Intel/Microsoft __int64:
// we have Borland/Microsoft __int64:
//
typedef __int64 intmax_t;
typedef unsigned __int64 uintmax_t;
@ -272,9 +272,9 @@ BOOST_HAS_STDINT_H is defined (John Maddock).
#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H)
# define BOOST__STDC_CONSTANT_MACROS_DEFINED
# if defined(BOOST_HAS_MS_INT64)
# if (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520))
//
// Borland/Intel/Microsoft compilers have width specific suffixes:
// Borland/Microsoft compilers have width specific suffixes:
//
# define INT8_C(value) value##i8
# define INT16_C(value) value##i16

View File

@ -12,13 +12,9 @@
#include <boost/integer_fwd.hpp> // self include
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT, etc.
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT
#include <boost/limits.hpp> // for std::numeric_limits
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/pending/ct_if.hpp> // for boost::ct_if<>
#endif
namespace boost
{
@ -34,22 +30,9 @@ template < unsigned long Val, int Place = 0, int Index
= std::numeric_limits<unsigned long>::digits >
struct static_log2_helper_t;
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template < unsigned long Val, int Place >
struct static_log2_helper_t< Val, Place, 1 >;
#else
template < int Place >
struct static_log2_helper_final_step;
template < unsigned long Val, int Place = 0, int Index
= std::numeric_limits<unsigned long>::digits >
struct static_log2_helper_nopts_t;
#endif
// Recursively build the logarithm by examining the upper bits
template < unsigned long Val, int Place, int Index >
struct static_log2_helper_t
@ -67,11 +50,7 @@ private:
: Place );
BOOST_STATIC_CONSTANT( int, new_index = Index - half_place );
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef static_log2_helper_t<new_val, new_place, new_index> next_step_type;
#else
typedef static_log2_helper_nopts_t<new_val, new_place, new_index> next_step_type;
#endif
public:
BOOST_STATIC_CONSTANT( int, value = next_step_type::value );
@ -79,8 +58,6 @@ public:
}; // boost::detail::static_log2_helper_t
// Non-recursive case
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template < unsigned long Val, int Place >
struct static_log2_helper_t< Val, Place, 1 >
{
@ -89,33 +66,6 @@ public:
}; // boost::detail::static_log2_helper_t
#else
template < int Place >
struct static_log2_helper_final_step
{
public:
BOOST_STATIC_CONSTANT( int, value = Place );
}; // boost::detail::static_log2_helper_final_step
template < unsigned long Val, int Place, int Index >
struct static_log2_helper_nopts_t
{
private:
typedef static_log2_helper_t<Val, Place, Index> recursive_step_type;
typedef static_log2_helper_final_step<Place> final_step_type;
typedef typename ct_if<( Index != 1 ), recursive_step_type,
final_step_type>::type next_step_type;
public:
BOOST_STATIC_CONSTANT( int, value = next_step_type::value );
}; // boost::detail::static_log2_helper_nopts_t
#endif
} // namespace detail

View File

@ -35,20 +35,10 @@
* Therefore, avoid explicit function template instantiations.
*/
#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
template<typename T> inline T make_char_numeric_for_streaming(T x) { return x; }
namespace fix{
inline int make_char_numeric_for_streaming(char c) { return c; }
inline int make_char_numeric_for_streaming(signed char c) { return c; }
inline int make_char_numeric_for_streaming(unsigned char c) { return c; }
}
using namespace fix;
#else
template<typename T> inline T make_char_numeric_for_streaming(T x) { return x; }
inline int make_char_numeric_for_streaming(char c) { return c; }
inline int make_char_numeric_for_streaming(signed char c) { return c; }
inline int make_char_numeric_for_streaming(unsigned char c) { return c; }
#endif
template<class T>
void runtest(const char * type, T)
@ -83,7 +73,7 @@ int test_main(int, char*[])
runtest("long", long());
typedef unsigned long unsigned_long;
runtest("unsigned long", unsigned_long());
#if !defined(BOOST_NO_INT64_T) && (!defined(BOOST_MSVC) || BOOST_MSVC > 1300) && !defined(__BORLANDC__) && !defined(__BEOS__)
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_MSVC) && !defined(__BORLANDC__) && !defined(__BEOS__)
//
// MS/Borland compilers can't support 64-bit member constants
// BeOS doesn't have specialisations for long long in SGI's <limits> header.