From 01097403777f7d5148258105e7ad583b7f34fe13 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 7 Jul 2000 16:04:40 +0000 Subject: [PATCH 01/21] 1.16.1 initial CVS checkin [SVN r7620] --- .gitattributes | 96 ++++++++++++++++++++++++ include/boost/cast.hpp | 162 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 258 insertions(+) create mode 100644 .gitattributes create mode 100644 include/boost/cast.hpp 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/cast.hpp b/include/boost/cast.hpp new file mode 100644 index 0000000..e4c6829 --- /dev/null +++ b/include/boost/cast.hpp @@ -0,0 +1,162 @@ +// boost cast.hpp header file ----------------------------------------------// + +// (C) Copyright boost.org 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 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams) +// 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes) +// 27 Jun 00 More MSVC6 workarounds +// 15 Jun 00 Add workarounds for MSVC6 +// 2 Feb 00 Remove bad_numeric_cast ";" syntax error (Doncho Angelov) +// 26 Jan 00 Add missing throw() to bad_numeric_cast::what(0 (Adam Levar) +// 29 Dec 99 Change using declarations so usages in other namespaces work +// correctly (Dave Abrahams) +// 23 Sep 99 Change polymorphic_downcast assert to also detect M.I. errors +// as suggested Darin Adler and improved by Valentin Bonnard. +// 2 Sep 99 Remove controversial asserts, simplify, rename. +// 30 Aug 99 Move to cast.hpp, replace value_cast with numeric_cast, +// place in nested namespace. +// 3 Aug 99 Initial version + +#ifndef BOOST_CAST_HPP +#define BOOST_CAST_HPP + +# include +# include +# include +# include + +// 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 +// appear in the function's argument list. +// +// TODO: Add this to config.hpp? +# if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 // 1200 = VC6 +# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::detail::type_wrapper* = 0 +# define BOOST_EXPLICIT_TARGET ,::boost::detail::type_wrapper* +# else +# define BOOST_EXPLICIT_DEFAULT_TARGET +# define BOOST_EXPLICIT_TARGET +# endif + +namespace boost +{ + namespace detail { + template struct type_wrapper {}; + } +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // 1200 = VC6 + namespace cast + { +#endif + +// See the documentation for descriptions of how to choose between +// static_cast<>, dynamic_cast<>, polymorphic_cast<>. and down_cast<> + +// polymorphic_cast --------------------------------------------------------// + + // Runtime checked polymorphic downcasts and crosscasts. + // Suggested in The C++ Programming Language, 3rd Ed, Bjarne Stroustrup, + // section 15.8 exercise 1, page 425. + + template + inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET) + { + Target tmp = dynamic_cast(x); + if ( tmp == 0 ) throw std::bad_cast(); + return tmp; + } + +// polymorphic_downcast ----------------------------------------------------// + + // assert() checked polymorphic downcast. Crosscasts prohibited. + + // WARNING: Because this cast uses assert(), it violates the One Definition + // Rule if NDEBUG is inconsistently defined across translation units. + + // Contributed by Dave Abrahams + + template + inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET) + { + assert( dynamic_cast(x) == x ); // detect logic error + return static_cast(x); + } + +// implicit_cast -----------------------------------------------------------// +// +// Removed due to uncertain purpose. Use either numeric_cast (see below) +// or static_cast according to the need. + +// numeric_cast and related exception --------------------------------------// + +// Contributed by Kevlin Henney + +// bad_numeric_cast --------------------------------------------------------// + + // exception used to indicate runtime numeric_cast failure + class bad_numeric_cast : public std::bad_cast + { + public: + // constructors, destructors and assignment operator defaulted + + // function inlined for brevity and consistency with rest of library + virtual const char *what() const throw() + { + return "bad numeric cast: loss of range in numeric_cast"; + } + }; + +// numeric_cast ------------------------------------------------------------// + + template + inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET) + { + // typedefs abbreviating respective trait classes + typedef std::numeric_limits arg_traits; + typedef std::numeric_limits result_traits; + + // typedefs that act as compile time assertions + // (to be replaced by boost compile time assertions + // as and when they become available and are stable) + typedef bool argument_must_be_numeric[arg_traits::is_specialized]; + typedef bool result_must_be_numeric[result_traits::is_specialized]; + + if( (arg < 0 && !result_traits::is_signed) || // loss of negative range + (arg_traits::is_signed && + arg < result_traits::min()) || // underflow + arg > result_traits::max() ) // overflow + throw bad_numeric_cast(); + return static_cast(arg); + } + +// Visual C++ workarounds --------------------------------------------------// + +# if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // 1200 = VC6 + } // namespace cast + + using ::boost::cast::polymorphic_cast; + using ::boost::cast::polymorphic_downcast; + using ::boost::cast::bad_numeric_cast; + using ::boost::cast::numeric_cast; +# else + namespace cast { + using ::boost::polymorphic_cast; + using ::boost::polymorphic_downcast; + using ::boost::bad_numeric_cast; + using ::boost::numeric_cast; + } +# endif + +# undef BOOST_EXPLICIT_DEFAULT_TARGET +# undef BOOST_EXPLICIT_TARGET + +} // namespace boost + +#endif // BOOST_CAST_HPP + From 83720de8d0a6a28ddbdc7ef53b1ae3cd6acfed96 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 26 Jul 2000 20:32:15 +0000 Subject: [PATCH 02/21] This commit was manufactured by cvs2svn to create branch 'iterator-adaptors'. [SVN r7633] --- include/boost/cast.hpp | 97 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/include/boost/cast.hpp b/include/boost/cast.hpp index e4c6829..5e3009e 100644 --- a/include/boost/cast.hpp +++ b/include/boost/cast.hpp @@ -9,6 +9,7 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 15 Jul 00 Suppress numeric_cast warnings for GCC, Borland and MSVC (Dave Abrahams) // 30 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams) // 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes) // 27 Jun 00 More MSVC6 workarounds @@ -114,6 +115,79 @@ namespace boost // numeric_cast ------------------------------------------------------------// +// Move to config.hpp? +#if 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. +# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#endif + +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + // less_than_type_min - + // x_is_signed should be numeric_limits::is_signed + // y_is_signed should be numeric_limits::is_signed + // y_min should be numeric_limits::min() + // + // check(x, y_min) returns true iff x < y_min without invoking comparisons + // between signed and unsigned values. + // + // "poor man's partial specialization" is in use here. + template + struct less_than_type_min + { + template + static bool check(X x, Y y_min) + { return x < y_min; } + }; + + template <> + struct less_than_type_min + { + template + static bool check(X, Y) + { return false; } + }; + + template <> + struct less_than_type_min + { + template + static bool check(X x, Y) + { return x < 0; } + }; + + // greater_than_type_max - + // same_sign should be: + // numeric_limits::is_signed == numeric_limits::is_signed + // y_max should be numeric_limits::max() + // + // check(x, y_max) returns true iff x > y_max without invoking comparisons + // between signed and unsigned values. + // + // "poor man's partial specialization" is in use here. + template + struct greater_than_type_max; + + template<> + struct greater_than_type_max + { + template + static bool check(X x, Y y_max) + { return x > y_max; } + }; + + template <> + struct greater_than_type_max + { + // What does the standard say about this? I think it's right, and it + // will work with every compiler I know of. + template + static bool check(X x, Y) + { return x >= 0 && static_cast(static_cast(x)) != x; } + }; +#endif + template inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET) { @@ -121,17 +195,38 @@ namespace boost typedef std::numeric_limits arg_traits; typedef std::numeric_limits result_traits; +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS // typedefs that act as compile time assertions // (to be replaced by boost compile time assertions // as and when they become available and are stable) typedef bool argument_must_be_numeric[arg_traits::is_specialized]; typedef bool result_must_be_numeric[result_traits::is_specialized]; - if( (arg < 0 && !result_traits::is_signed) || // loss of negative range + const bool arg_is_signed = arg_traits::is_signed; + const bool result_is_signed = result_traits::is_signed; + const bool same_sign = arg_is_signed == result_is_signed; + + if (less_than_type_min::check(arg, result_traits::min()) + || greater_than_type_max::check(arg, result_traits::max()) + ) + +#else // We need to use #pragma hacks if available + +# if BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4018) +# endif + if ( (arg < 0 && !result_traits::is_signed) || // loss of negative range (arg_traits::is_signed && arg < result_traits::min()) || // underflow arg > result_traits::max() ) // overflow +# if BOOST_MSVC +# pragma warning(pop) +# endif +#endif + { throw bad_numeric_cast(); + } return static_cast(arg); } From 66834ebe526b30900ea54c18559ef49b1879e40d Mon Sep 17 00:00:00 2001 From: nobody Date: Sat, 9 Sep 2000 10:20:25 +0000 Subject: [PATCH 03/21] This commit was manufactured by cvs2svn to create branch 'boost-graph-library'. [SVN r7698] --- include/boost/cast.hpp | 97 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/include/boost/cast.hpp b/include/boost/cast.hpp index e4c6829..5e3009e 100644 --- a/include/boost/cast.hpp +++ b/include/boost/cast.hpp @@ -9,6 +9,7 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 15 Jul 00 Suppress numeric_cast warnings for GCC, Borland and MSVC (Dave Abrahams) // 30 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams) // 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes) // 27 Jun 00 More MSVC6 workarounds @@ -114,6 +115,79 @@ namespace boost // numeric_cast ------------------------------------------------------------// +// Move to config.hpp? +#if 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. +# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#endif + +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + // less_than_type_min - + // x_is_signed should be numeric_limits::is_signed + // y_is_signed should be numeric_limits::is_signed + // y_min should be numeric_limits::min() + // + // check(x, y_min) returns true iff x < y_min without invoking comparisons + // between signed and unsigned values. + // + // "poor man's partial specialization" is in use here. + template + struct less_than_type_min + { + template + static bool check(X x, Y y_min) + { return x < y_min; } + }; + + template <> + struct less_than_type_min + { + template + static bool check(X, Y) + { return false; } + }; + + template <> + struct less_than_type_min + { + template + static bool check(X x, Y) + { return x < 0; } + }; + + // greater_than_type_max - + // same_sign should be: + // numeric_limits::is_signed == numeric_limits::is_signed + // y_max should be numeric_limits::max() + // + // check(x, y_max) returns true iff x > y_max without invoking comparisons + // between signed and unsigned values. + // + // "poor man's partial specialization" is in use here. + template + struct greater_than_type_max; + + template<> + struct greater_than_type_max + { + template + static bool check(X x, Y y_max) + { return x > y_max; } + }; + + template <> + struct greater_than_type_max + { + // What does the standard say about this? I think it's right, and it + // will work with every compiler I know of. + template + static bool check(X x, Y) + { return x >= 0 && static_cast(static_cast(x)) != x; } + }; +#endif + template inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET) { @@ -121,17 +195,38 @@ namespace boost typedef std::numeric_limits arg_traits; typedef std::numeric_limits result_traits; +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS // typedefs that act as compile time assertions // (to be replaced by boost compile time assertions // as and when they become available and are stable) typedef bool argument_must_be_numeric[arg_traits::is_specialized]; typedef bool result_must_be_numeric[result_traits::is_specialized]; - if( (arg < 0 && !result_traits::is_signed) || // loss of negative range + const bool arg_is_signed = arg_traits::is_signed; + const bool result_is_signed = result_traits::is_signed; + const bool same_sign = arg_is_signed == result_is_signed; + + if (less_than_type_min::check(arg, result_traits::min()) + || greater_than_type_max::check(arg, result_traits::max()) + ) + +#else // We need to use #pragma hacks if available + +# if BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4018) +# endif + if ( (arg < 0 && !result_traits::is_signed) || // loss of negative range (arg_traits::is_signed && arg < result_traits::min()) || // underflow arg > result_traits::max() ) // overflow +# if BOOST_MSVC +# pragma warning(pop) +# endif +#endif + { throw bad_numeric_cast(); + } return static_cast(arg); } From f12aed0e335454fa38aa37ea750a819618379be1 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 27 Jun 2001 22:12:20 +0000 Subject: [PATCH 04/21] This commit was manufactured by cvs2svn to create branch 'iter-adaptor-and-categories'. [SVN r10453] From 6814aea9888d4e57abc01444d5bdad448b9f1897 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 13 Apr 2004 12:19:16 +0000 Subject: [PATCH 05/21] This commit was manufactured by cvs2svn to create branch 'function_signature_patches_1_31'. [SVN r22633] From 11dd5bb72671b4f67231393cceb357adbba0c7e4 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 23 Aug 2007 19:28:19 +0000 Subject: [PATCH 06/21] Create a development branch for the hash library. [SVN r38869] From 946bd8356efa7f7d6ddc38b99e1978b74984b723 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 21 Oct 2007 07:28:23 +0000 Subject: [PATCH 07/21] Merge from trunk. [SVN r40260] --- include/boost/detail/lcast_precision.hpp | 12 +++++++++--- include/boost/lexical_cast.hpp | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/boost/detail/lcast_precision.hpp b/include/boost/detail/lcast_precision.hpp index 5bd96fd..ef23c8a 100644 --- a/include/boost/detail/lcast_precision.hpp +++ b/include/boost/detail/lcast_precision.hpp @@ -21,7 +21,13 @@ #include #endif -#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || \ + (defined(BOOST_MSVC) && (BOOST_MSVC<1310)) + +#define BOOST_LCAST_NO_COMPILE_TIME_PRECISION +#endif + +#ifdef BOOST_LCAST_NO_COMPILE_TIME_PRECISION #include #else #include @@ -31,7 +37,7 @@ namespace boost { namespace detail { class lcast_abstract_stub {}; -#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION // Calculate an argument to pass to std::ios_base::precision from // lexical_cast. See alternative implementation for broken standard // libraries in lcast_get_precision below. Keep them in sync, please. @@ -92,7 +98,7 @@ struct lcast_precision template inline std::streamsize lcast_get_precision(T* = 0) { -#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) +#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION return lcast_precision::value; #else // Follow lcast_precision algorithm at run-time: diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index 1cd23f7..8f40d47 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -307,7 +307,7 @@ namespace boost #undef BOOST_AUX_LEXICAL_CAST_DEF #undef BOOST_AUX_LEXICAL_CAST_DEF1 -#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION // This #if is in sync with lcast_precision // Helper for floating point types. @@ -376,7 +376,7 @@ namespace boost }; #endif // #ifndef DISABLE_WIDE_CHAR_SUPPORT -#endif // #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +#endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION } namespace detail // '0' and '-' constants From 703f75e029a4a3d7ea5db096e69c7e1d316a0fcd Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 2 Dec 2007 10:07:42 +0000 Subject: [PATCH 08/21] Create a branch to fix links on. [SVN r41573] From 8b9a9a519f090564b6c2db9d6d76ad1ef18fa302 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 2 Dec 2007 23:55:38 +0000 Subject: [PATCH 09/21] Fix the people links in the conversion documentation. [SVN r41599] --- cast.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cast.htm b/cast.htm index 587d08a..77364c4 100644 --- a/cast.htm +++ b/cast.htm @@ -120,10 +120,10 @@ void f( Fruit * fruit ) {

polymorphic_cast was suggested by Bjarne Stroustrup in "The C++ Programming Language".
polymorphic_downcast was contributed by Dave Abrahams.
+ "http://beta.boost.org/users/people/dave_abrahams.html">Dave Abrahams.
An old numeric_cast
that was contributed by Kevlin Henney is now superseeded by the Boost Numeric Conversion Library

+ "http://beta.boost.org/users/people/kevlin_henney.html">Kevlin Henney is now superseeded by the Boost Numeric Conversion Library


Revised From 07a4656255d64e6212ca8d54d09cbe90aa8ba90d Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 7 Dec 2007 01:12:02 +0000 Subject: [PATCH 10/21] Merge from trunk, finally. [SVN r41817] --- lexical_cast.htm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lexical_cast.htm b/lexical_cast.htm index 2a08541..6e38014 100644 --- a/lexical_cast.htm +++ b/lexical_cast.htm @@ -194,7 +194,18 @@ public: Exception used to indicate runtime lexical_cast failure. -


+ +
+

BOOST_LEXICAL_CAST_ASSUME_C_LOCALE

+
#define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+
+or,
+
+g++ -DBOOST_LEXICAL_CAST_ASSUME_C_LOCALE ...  (gcc on Linux/Unix)
+cl.exe /DBOOST_LEXICAL_CAST_ASSUME_C_LOCALE ... (Visual C++ on Windows)
+
+Eliminate an overhead of std::locale if your program runs in the "C" locale. If the option is set but a program runs in other locale, lexical_cast result is unspecified. +

Frequently Asked Questions

Q: Why does lexical_cast<int8_t>("127") throw bad_lexical_cast? @@ -219,7 +230,7 @@ public:

  • [N1973] Kevlin Henney, Beman Dawes, Lexical Conversion Library Proposal for TR2, N1973.
  • [Tuning] Alexander Nasonov, Fine Tuning for lexical_cast, - Overload #74, + Overload #74 (PDF), August 2006.
  • Changes

    From 9c1b024a9f3782f4ea543febaa17d9c116e0496a Mon Sep 17 00:00:00 2001 From: Jonathan Turkanis Date: Tue, 18 Dec 2007 20:08:11 +0000 Subject: [PATCH 11/21] Branch for Iostreams development [SVN r42144] From 7b9faca0b476526d64b8f724056d8b65c079203e Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 22 Dec 2007 15:36:31 +0000 Subject: [PATCH 12/21] Merge from trunk. [SVN r42243] --- include/boost/lexical_cast.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index 2794c86..44c7a66 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -3,7 +3,7 @@ // Boost lexical_cast.hpp header -------------------------------------------// // -// See http://www.boost.org/libs/converston for documentation. +// See http://www.boost.org/libs/conversion for documentation. // See end of this header for rights and permissions. // // what: lexical_cast custom keyword cast From 322f38f032959c111f8865aae918d5cb32f299d3 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 7 Feb 2008 20:47:08 +0000 Subject: [PATCH 13/21] Roll back links to the beta site. [SVN r43163] --- cast.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cast.htm b/cast.htm index 77364c4..587d08a 100644 --- a/cast.htm +++ b/cast.htm @@ -120,10 +120,10 @@ void f( Fruit * fruit ) {

    polymorphic_cast was suggested by Bjarne Stroustrup in "The C++ Programming Language".
    polymorphic_downcast was contributed by Dave Abrahams.
    + "../../people/dave_abrahams.htm">Dave Abrahams.
    An old numeric_cast
    that was contributed by Kevlin Henney is now superseeded by the Boost Numeric Conversion Library

    + "../../people/kevlin_henney.htm">Kevlin Henney is now superseeded by the Boost Numeric Conversion Library


    Revised From 6bdc42d48ae5a9c3cf0beabdf9e7d0b210526862 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 7 Feb 2008 22:27:50 +0000 Subject: [PATCH 14/21] Change people links to link to the site. [SVN r43168] --- cast.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cast.htm b/cast.htm index 587d08a..cb8add6 100644 --- a/cast.htm +++ b/cast.htm @@ -120,10 +120,10 @@ void f( Fruit * fruit ) {

    polymorphic_cast was suggested by Bjarne Stroustrup in "The C++ Programming Language".
    polymorphic_downcast was contributed by Dave Abrahams.
    + "http://www.boost.org/people/dave_abrahams.htm">Dave Abrahams.
    An old numeric_cast
    that was contributed by Kevlin Henney is now superseeded by the Boost Numeric Conversion Library

    + "http://www.boost.org/people/kevlin_henney.htm">Kevlin Henney is now superseeded by the Boost Numeric Conversion Library


    Revised From 8c0f4acb522941f58efce6c99d602008cffafdb9 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 23 Sep 2008 19:45:43 +0000 Subject: [PATCH 15/21] Branch for adding initializer list support (only in the unreleased gcc 4.4 at the moment). [SVN r48931] --- include/boost/implicit_cast.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/implicit_cast.hpp diff --git a/include/boost/implicit_cast.hpp b/include/boost/implicit_cast.hpp old mode 100755 new mode 100644 From f5b1744069285ad98fb57dd6e92798448ed43de8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 19 Jan 2010 20:47:20 +0000 Subject: [PATCH 16/21] Branch for merging Boost.Build and Boost.Jam completely. [SVN r59143] --- include/boost/implicit_cast.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/implicit_cast.hpp diff --git a/include/boost/implicit_cast.hpp b/include/boost/implicit_cast.hpp old mode 100755 new mode 100644 From cbd8204ae01fd27a25177ded373a8aa7b72be686 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 20 Apr 2010 21:11:27 +0000 Subject: [PATCH 17/21] Create a branch for inspect fixes. [SVN r61439] --- include/boost/implicit_cast.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/implicit_cast.hpp diff --git a/include/boost/implicit_cast.hpp b/include/boost/implicit_cast.hpp old mode 100755 new mode 100644 From f6a47bfbba7780432de2172b0bd7d62b1870b995 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Wed, 9 Jun 2010 11:34:33 +0000 Subject: [PATCH 18/21] v2, v3, integration branch [SVN r62649] --- include/boost/implicit_cast.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/implicit_cast.hpp diff --git a/include/boost/implicit_cast.hpp b/include/boost/implicit_cast.hpp old mode 100755 new mode 100644 From 9fb010da023f817016a1a8dae96f9f7ccc83eda9 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 4 Feb 2011 21:18:24 +0000 Subject: [PATCH 19/21] Branch for working on the documentation tools documentation. [SVN r68640] --- include/boost/implicit_cast.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/implicit_cast.hpp diff --git a/include/boost/implicit_cast.hpp b/include/boost/implicit_cast.hpp old mode 100755 new mode 100644 From a7df10e078bfbff4a04cd8f1862764a093b11aa2 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 18 Mar 2012 20:54:17 +0000 Subject: [PATCH 20/21] Create branches/filesystem-v3 for v2 removal [SVN r77385] --- include/boost/implicit_cast.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/implicit_cast.hpp diff --git a/include/boost/implicit_cast.hpp b/include/boost/implicit_cast.hpp old mode 100755 new mode 100644 From 2b82fa52cd808b3a3f02df7385818c6e04381880 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 23 Mar 2012 12:04:44 +0000 Subject: [PATCH 21/21] Branch for 2nd try at V2 removal [SVN r77497] --- include/boost/implicit_cast.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 include/boost/implicit_cast.hpp diff --git a/include/boost/implicit_cast.hpp b/include/boost/implicit_cast.hpp old mode 100755 new mode 100644