1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>Changes</title> 6<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="../boost_lexical_cast.html" title="Chapter 21. Boost.Lexical_Cast 1.0"> 10<link rel="prev" href="frequently_asked_questions.html" title="Frequently Asked Questions"> 11<link rel="next" href="performance.html" title="Performance"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> 16<td align="center"><a href="../../../index.html">Home</a></td> 17<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="frequently_asked_questions.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_lexical_cast.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="performance.html"><img src="../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="section"> 27<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 28<a name="boost_lexical_cast.changes"></a><a class="link" href="changes.html" title="Changes">Changes</a> 29</h2></div></div></div> 30<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 31<li class="listitem"> 32 <span class="bold"><strong>boost 1.56.0 :</strong></span> 33 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"> 34 Added <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">conversion</span><span class="special">::</span><span class="identifier">try_lexical_convert</span></code> functions. 35 </li></ul></div> 36 </li> 37<li class="listitem"> 38 <span class="bold"><strong>boost 1.54.0 :</strong></span> 39 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"> 40 Fix some issues with <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int128_type</span></code> 41 and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uint128_type</span></code> conversions. Notify 42 user at compile time if the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span></code> 43 are not specialized for 128bit types and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">lexical_cast</span></code> 44 can not make conversions. 45 </li></ul></div> 46 </li> 47<li class="listitem"> 48 <span class="bold"><strong>boost 1.54.0 :</strong></span> 49 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 50<li class="listitem"> 51 Added code to convert <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int128_type</span></code> 52 and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uint128_type</span></code> types (requires GCC 53 4.7 or higher). 54 </li> 55<li class="listitem"> 56 Conversions to pointers will now fail to compile, instead of throwing 57 at runtime. 58 </li> 59<li class="listitem"> 60 Restored ability to get pointers to <code class="computeroutput"><span class="identifier">lexical_cast</span></code> 61 function (was broken in 1.53.0). 62 </li> 63</ul></div> 64 </li> 65<li class="listitem"> 66 <span class="bold"><strong>boost 1.53.0 :</strong></span> 67 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"> 68 Much better input and output streams detection for user defined types. 69 </li></ul></div> 70 </li> 71<li class="listitem"> 72 <span class="bold"><strong>boost 1.52.0 :</strong></span> 73 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 74<li class="listitem"> 75 Restored compilation on MSVC-2003 (was broken in 1.51.0). 76 </li> 77<li class="listitem"> 78 Added <code class="computeroutput"><span class="identifier">lexical_cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">CharType</span><span class="special">*</span> 79 <span class="identifier">chars</span><span class="special">,</span> 80 <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">count</span><span class="special">)</span></code> function overload. 81 </li> 82</ul></div> 83 </li> 84<li class="listitem"> 85 <span class="bold"><strong>boost 1.51.0 :</strong></span> 86 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"> 87 Better performance, less memory usage for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special"><</span><span class="identifier">character_type</span><span class="special">,</span> <span class="identifier">N</span><span class="special">></span></code> and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">array</span><span class="special"><</span><span class="identifier">character_type</span><span class="special">,</span> <span class="identifier">N</span><span class="special">></span></code> conversions. 88 </li></ul></div> 89 </li> 90<li class="listitem"> 91 <span class="bold"><strong>boost 1.50.0 :</strong></span> 92 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 93<li class="listitem"> 94 <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bad_lexical_cast</span></code> exception is now 95 globaly visible and can be catched even if code is compiled with 96 -fvisibility=hidden. 97 </li> 98<li class="listitem"> 99 Now it is possible to compile library with disabled exceptions. 100 </li> 101<li class="listitem"> 102 Better performance, less memory usage and bugfixes for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">iterator_range</span><span class="special"><</span><span class="identifier">character_type</span><span class="special">*></span></code> 103 conversions. 104 </li> 105</ul></div> 106 </li> 107<li class="listitem"> 108 <span class="bold"><strong>boost 1.49.0 :</strong></span> 109 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 110<li class="listitem"> 111 Restored work with typedefed wchar_t (compilation flag /Zc:wchar_t- 112 for Visual Studio). 113 </li> 114<li class="listitem"> 115 Better performance and less memory usage for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">basic_string</span></code> 116 conversions. 117 </li> 118</ul></div> 119 </li> 120<li class="listitem"> 121 <span class="bold"><strong>boost 1.48.0 :</strong></span> 122 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 123<li class="listitem"> 124 Added code to work with Inf and NaN on any platform. 125 </li> 126<li class="listitem"> 127 Better performance and less memory usage for conversions to float 128 type (and to double type, if <code class="computeroutput"><span class="keyword">sizeof</span><span class="special">(</span><span class="keyword">double</span><span class="special">)</span> <span class="special"><</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">)</span></code>). 129 </li> 130</ul></div> 131 </li> 132<li class="listitem"> 133 <span class="bold"><strong>boost 1.47.0 :</strong></span> 134 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 135<li class="listitem"> 136 Optimizations for "C" and other locales without number 137 grouping. 138 </li> 139<li class="listitem"> 140 Better performance and less memory usage for unsigned char and signed 141 char conversions. 142 </li> 143<li class="listitem"> 144 Better performance and less memory usage for conversions to arithmetic 145 types. 146 </li> 147<li class="listitem"> 148 Better performance and less memory usage for conversions from arithmetic 149 type to arithmetic type. 150 </li> 151<li class="listitem"> 152 Directly construct Target from Source on some conversions (like conversions 153 from string to string, from char array to string, from char to char 154 and others). 155 </li> 156</ul></div> 157 </li> 158<li class="listitem"> 159 <span class="bold"><strong>boost 1.34.0 :</strong></span> 160 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"> 161 Better performance for many combinations of Source and Target types. 162 For more details refer to Alexander Nasonovs article <a href="http://accu.org/index.php/journals/1375" target="_top">Fine 163 Tuning for lexical_cast, Overload #74, August 2006</a> <a href="http://www.accu.org/var/uploads/journals/overload74.pdf" target="_top">(PDF)</a>. 164 </li></ul></div> 165 </li> 166<li class="listitem"> 167 <span class="bold"><strong>boost 1.33.0 :</strong></span> 168 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 169<li class="listitem"> 170 Call-by-const reference for the parameters. This requires partial 171 specialization of class templates, so it doesn't work for MSVC 6, 172 and it uses the original pass by value there. 173 </li> 174<li class="listitem"> 175 The MSVC 6 support is deprecated, and will be removed in a future 176 Boost version. 177 </li> 178</ul></div> 179 </li> 180<li class="listitem"> 181 <span class="bold"><strong>Earlier :</strong></span> 182 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 183<li class="listitem"> 184 The previous version of lexical_cast used the default stream precision 185 for reading and writing floating-point numbers. For numerics that 186 have a corresponding specialization of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span></code>, 187 the current version now chooses a precision to match. 188 </li> 189<li class="listitem"> 190 The previous version of lexical_cast did not support conversion to 191 or from any wide-character-based types. For compilers with full language 192 and library support for wide characters, <code class="computeroutput"><span class="identifier">lexical_cast</span></code> 193 now supports conversions from <code class="computeroutput"><span class="keyword">wchar_t</span></code>, 194 <code class="computeroutput"><span class="keyword">wchar_t</span> <span class="special">*</span></code>, 195 and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">wstring</span></code> and to <code class="computeroutput"><span class="keyword">wchar_t</span></code> 196 and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">wstring</span></code>. 197 </li> 198<li class="listitem"> 199 The previous version of <code class="computeroutput"><span class="identifier">lexical_cast</span></code> 200 assumed that the conventional stream extractor operators were sufficient 201 for reading values. However, string I/O is asymmetric, with the result 202 that spaces play the role of I/O separators rather than string content. 203 The current version fixes this error for <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code> 204 and, where supported, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">wstring</span></code>: 205 <code class="computeroutput"><span class="identifier">lexical_cast</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">>(</span><span class="string">"Hello, World"</span><span class="special">)</span></code> 206 succeeds instead of failing with a <code class="computeroutput"><span class="identifier">bad_lexical_cast</span></code> 207 exception. 208 </li> 209<li class="listitem"> 210 The previous version of <code class="computeroutput"><span class="identifier">lexical_cast</span></code> 211 allowed unsafe and meaningless conversions to pointers. The current 212 version now throws a <code class="computeroutput"><span class="identifier">bad_lexical_cast</span></code> 213 for conversions to pointers: <code class="computeroutput"><span class="identifier">lexical_cast</span><span class="special"><</span><span class="keyword">char</span> 214 <span class="special">*>(</span><span class="string">"Goodbye, 215 World"</span><span class="special">)</span></code> now 216 throws an exception instead of causing undefined behavior. 217 </li> 218</ul></div> 219 </li> 220</ul></div> 221</div> 222<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 223<td align="left"></td> 224<td align="right"><div class="copyright-footer">Copyright © 2000-2005 Kevlin Henney<br>Copyright © 2006-2010 Alexander Nasonov<br>Copyright © 2011-2020 Antony Polukhin<p> 225 Distributed under the Boost Software License, Version 1.0. (See accompanying 226 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 227 </p> 228</div></td> 229</tr></table> 230<hr> 231<div class="spirit-nav"> 232<a accesskey="p" href="frequently_asked_questions.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_lexical_cast.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="performance.html"><img src="../../../doc/src/images/next.png" alt="Next"></a> 233</div> 234</body> 235</html> 236