Compare commits

...

7 Commits

Author SHA1 Message Date
nobody 5e5f58d624 This commit was manufactured by cvs2svn to create tag
'Version_1_21_1'.

[SVN r9561]
2001-03-14 15:36:54 +00:00
Beman Dawes 27028a7d32 All final 1.20.2 changes, including fixing broken hyperlinks
[SVN r9071]
2001-02-10 14:42:14 +00:00
Dave Abrahams bc9129719e Undid a bug I introduced yesterday. numeric_cast<> never
worked with stock GCC; trying to get it to do that broke
vc-stlport.


[SVN r8703]
2001-01-22 04:27:00 +00:00
Dave Abrahams 3cc0db15d1 removed use of <limits> for portability to raw GCC
[SVN r8670]
2001-01-21 05:37:41 +00:00
Dave Abrahams c66f9eb92c Fixed a warning for MSVC
Added changelog


[SVN r8669]
2001-01-21 05:35:13 +00:00
Dave Abrahams e923c638b4 BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
Removed unused BOOST_EXPLICIT_TARGET macro.
Moved boost::detail::type to boost/type.hpp.
Made it compile with stock gcc again


[SVN r8663]
2001-01-21 05:07:11 +00:00
Jens Maurer ed636dd362 bugfix: added destructor definition with empty exception specification
[SVN r8651]
2001-01-20 00:09:14 +00:00
4 changed files with 40 additions and 33 deletions
+4 -4
View File
@@ -9,13 +9,13 @@
// See http://www.boost.org for most recent version including documentation.
// Revision History
// 20 Jan 01 removed use of <limits> for portability to raw GCC (David Abrahams)
// 28 Jun 00 implicit_cast removed (Beman Dawes)
// 30 Aug 99 value_cast replaced by numeric_cast
// 3 Aug 99 Initial Version
#include <iostream>
#include <climits>
#include <limits>
#include <boost/cast.hpp>
# if SCHAR_MAX == LONG_MAX
@@ -95,8 +95,8 @@ int main( int argc, char * argv[] )
// tests which should succeed
long small_value = 1;
long small_negative_value = -1;
long large_value = std::numeric_limits<long>::max();
long large_negative_value = std::numeric_limits<long>::min();
long large_value = LONG_MAX;
long large_negative_value = LONG_MIN;
signed char c = 0;
c = large_value; // see if compiler generates warning
@@ -142,7 +142,7 @@ int main( int argc, char * argv[] )
if ( !caught_exception ) ++err_count;
caught_exception = false;
try { numeric_cast<int>( std::numeric_limits<double>::max() ); }
try { numeric_cast<int>( DBL_MAX ); }
catch (bad_numeric_cast)
{ cout<<"caught bad_numeric_cast #5\n"; caught_exception = true; }
if ( !caught_exception ) ++err_count;
+22 -25
View File
@@ -9,6 +9,13 @@
// See http://www.boost.org for most recent version including documentation.
// Revision History
// 21 Jan 01 Undid a bug I introduced yesterday. numeric_cast<> never
// worked with stock GCC; trying to get it to do that broke
// vc-stlport.
// 20 Jan 01 Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
// Removed unused BOOST_EXPLICIT_TARGET macro. Moved
// boost::detail::type to boost/type.hpp. Made it compile with
// stock gcc again (Dave Abrahams)
// 29 Nov 00 Remove nested namespace cast, cleanup spacing before Formal
// Review (Beman Dawes)
// 19 Oct 00 Fix numeric_cast for floating-point types (Dave Abrahams)
@@ -34,8 +41,11 @@
# include <boost/config.hpp>
# include <cassert>
# include <typeinfo>
# include <limits>
# include <typeinfo>
# include <boost/type.hpp>
# ifndef BOOST_NO_LIMITS
# include <limits>
# endif
// It has been demonstrated numerous times that MSVC 6.0 fails silently at link
// time if you use a template function which has template parameters that don't
@@ -43,20 +53,13 @@
//
// TODO: Add this to config.hpp?
# if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 // 1200 = VC6
# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::detail::type_wrapper<Target>* = 0
# define BOOST_EXPLICIT_TARGET ,::boost::detail::type_wrapper<Target>*
# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
# else
# define BOOST_EXPLICIT_DEFAULT_TARGET
# define BOOST_EXPLICIT_TARGET
# endif
namespace boost
{
namespace detail
{
template <class T> struct type_wrapper {};
}
// See the documentation for descriptions of how to choose between
// static_cast<>, dynamic_cast<>, polymorphic_cast<> and polymorphic_downcast<>
@@ -116,17 +119,6 @@ namespace boost
// numeric_cast ------------------------------------------------------------//
// Move to config.hpp?
#if defined(_RWSTD_VER) || (defined(__SGI_STL_PORT) && __SGI_STL_PORT <= 0x400 && __STL_STATIC_CONST_INIT_BUG)
// STLPort 4.0 doesn't define the static constants in numeric_limits<> so that they
// can be used at compile time if the compiler bug indicated by
// __STL_STATIC_CONST_INIT_BUG is present.
// Rogue wave STL (C++ Builder) also has broken numeric_limits
// with default template defining members out of line.
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
#endif
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
namespace detail
@@ -271,8 +263,10 @@ namespace boost
# pragma warning(disable : 4018)
# pragma warning(disable : 4146)
#elif defined(__BORLANDC__)
#pragma option push -w-8041
# pragma option push -w-8041
# endif
# ifndef BOOST_NO_LIMITS
// Move to namespace boost in utility.hpp?
template <class T>
struct fixed_numeric_limits : public std::numeric_limits<T>
@@ -283,10 +277,12 @@ namespace boost
? T(-std::numeric_limits<T>::max()) : std::numeric_limits<T>::min();
}
};
# endif // BOOST_NO_LIMITS
# if BOOST_MSVC
# pragma warning(pop)
#elif defined(__BORLANDC__)
#pragma option pop
# pragma option pop
# endif
} // namespace detail
@@ -295,10 +291,12 @@ namespace boost
template<typename Target, typename Source>
inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET)
{
#ifndef BOOST_NO_LIMITS
// typedefs abbreviating respective trait classes
typedef std::numeric_limits<Source> arg_traits;
typedef detail::fixed_numeric_limits<Target> result_traits;
#endif
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
// typedefs that act as compile time assertions
// (to be replaced by boost compile time assertions
@@ -338,7 +336,6 @@ namespace boost
} // numeric_cast
# undef BOOST_EXPLICIT_DEFAULT_TARGET
# undef BOOST_EXPLICIT_TARGET
} // namespace boost
+1 -1
View File
@@ -127,7 +127,7 @@ void log_errno(int yoko)
<hr>
<h2><a name="synopsis">Synopsis</a></h2>
Library features defined in <a href="lexical_cast.hpp"><code>&quot;boost/lexical_cast.hpp&quot;</code></a>:
Library features defined in <a href="../../boost/lexical_cast.hpp"><code>&quot;boost/lexical_cast.hpp&quot;</code></a>:
<blockquote>
<pre>
+13 -3
View File
@@ -2,6 +2,9 @@
// who: developed by Kevlin Henney
// when: November 2000
// where: tested with BCC 5.5, MSVC 6.0, and g++ 2.91
//
// ChangeLog:
// 20 Jan 2001 - Fixed a warning for MSVC (Dave Abrahams)
#ifndef TEST_INCLUDED
#define TEST_INCLUDED
@@ -40,6 +43,13 @@ namespace test // failure exception used to indicate checked test failures
{
}
// std::~string has no exception-specification (could throw anything),
// but we need to be compatible with std::~exception's empty one
// see std::15.4p13 and std::15.4p3
~failure() throw()
{
}
public: // usage
virtual const char * what() const throw()
@@ -104,14 +114,14 @@ namespace test // test utilities
check(lhs != rhs, "expected unequal values: " + description);
}
inline void check_null(const void * ptr, const std::string & description)
inline void check_null(const void* ptr, const std::string & description)
{
check(!ptr, "expected null pointer: " + description);
}
inline void check_non_null(const void * ptr, const std::string & description)
inline void check_non_null(const void* ptr, const std::string & description)
{
check(ptr, "expected non-null pointer: " + description);
check(ptr != 0, "expected non-null pointer: " + description);
}
}