Brian Silverman | f83c99f | 2018-08-04 23:36:58 -0700 | [diff] [blame^] | 1 | [library Boost.Lexical_Cast |
| 2 | [quickbook 1.5] |
| 3 | [version 1.0] |
| 4 | [copyright 2000-2005 Kevlin Henney] |
| 5 | [copyright 2006-2010 Alexander Nasonov] |
| 6 | [copyright 2011-2014 Antony Polukhin] |
| 7 | [category String and text processing] |
| 8 | [category Miscellaneous] |
| 9 | [license |
| 10 | Distributed under the Boost Software License, Version 1.0. |
| 11 | (See accompanying file LICENSE_1_0.txt or copy at |
| 12 | [@http://www.boost.org/LICENSE_1_0.txt]) |
| 13 | ] |
| 14 | ] |
| 15 | |
| 16 | [def __numericcast__ [@boost:libs/numeric/conversion/doc/html/boost_numericconversion/improved_numeric_cast__.html `boost::numeric_cast`]] |
| 17 | [def __proposallong__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1973.html Lexical Conversion Library Proposal for TR2, N1973 by Kevlin Henney and Beman Dawes]] |
| 18 | [def __proposalshort__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1973.html Lexical Conversion Library Proposal for TR2, N1973]] |
| 19 | |
| 20 | [section Motivation] |
| 21 | Sometimes a value must be converted to a literal text form, such as an [c++] `int` represented as a `std::string`, or vice-versa, when a `std::string` is interpreted as an `int`. Such examples are common when converting between data types internal to a program and representation external to a program, such as windows and configuration files. |
| 22 | |
| 23 | The standard C and C++ libraries offer a number of facilities for performing such conversions. However, they vary with their ease of use, extensibility, and safety. |
| 24 | |
| 25 | For instance, there are a number of limitations with the family of standard C functions typified by `atoi`: |
| 26 | |
| 27 | * Conversion is supported in one direction only: from text to internal data type. Converting the other way using the C library requires either the inconvenience and compromised safety of the `sprintf` function, or the loss of portability associated with non-standard functions such as `itoa`. |
| 28 | * The range of types supported is only a subset of the built-in numeric types, namely `int`, `long`, and `double`. |
| 29 | * The range of types cannot be extended in a uniform manner. For instance, conversion from string representation to complex or rational. |
| 30 | |
| 31 | The standard C functions typified by `strtol` have the same basic limitations, but offer finer control over the conversion process. However, for the common case such control is often either not required or not used. The `scanf` family of functions offer even greater control, but also lack safety and ease of use. |
| 32 | |
| 33 | The standard C++ library offers `stringstream` for the kind of in-core formatting being discussed. It offers a great deal of control over the formatting and conversion of I/O to and from arbitrary types through text. However, for simple conversions direct use of `stringstream` can be either clumsy (with the introduction of extra local variables and the loss of infix-expression convenience) or obscure (where `stringstream` objects are created as temporary objects in an expression). Facets provide a comprehensive concept and facility for controlling textual representation, but their perceived complexity and high entry level requires an extreme degree of involvement for simple conversions, and excludes all but a few programmers. |
| 34 | |
| 35 | The `lexical_cast` function template offers a convenient and consistent form for supporting common conversions to and from arbitrary types when they are represented as text. The simplification it offers is in expression-level convenience for such conversions. For more involved conversions, such as where precision or formatting need tighter control than is offered by the default behavior of `lexical_cast`, the conventional `std::stringstream` approach is recommended. Where the conversions are numeric to numeric, __numericcast__ may offer more reasonable behavior than `lexical_cast`. |
| 36 | |
| 37 | For a good discussion of the options and issues involved in string-based formatting, including comparison of `stringstream`, `lexical_cast`, and others, see Herb Sutter's article, [@http://www.gotw.ca/publications/mill19.htm The String Formatters of Manor Farm]. Also, take a look at the [link boost_lexical_cast.performance Performance] section. |
| 38 | [endsect] |
| 39 | |
| 40 | [section Examples] |
| 41 | |
| 42 | [import ../example/args_to_numbers.cpp] |
| 43 | |
| 44 | [section Strings to numbers conversion] [lexical_cast_args_example] [endsect] |
| 45 | |
| 46 | [import ../example/small_examples.cpp] |
| 47 | [section Numbers to strings conversion] [lexical_cast_log_errno] [endsect] |
| 48 | [section Converting to string without dynamic memory allocation] [lexical_cast_fixed_buffer] [endsect] |
| 49 | [section Converting part of the string] [lexical_cast_substring_conversion] [endsect] |
| 50 | |
| 51 | [import ../example/generic_stringize.cpp] |
| 52 | [section Generic programming (Boost.Fusion)] [lexical_cast_stringize] [endsect] |
| 53 | |
| 54 | [import ../example/variant_to_long_double.cpp] |
| 55 | [section Generic programming (Boost.Variant)] [lexical_cast_variant_to_long_double] [endsect] |
| 56 | |
| 57 | [endsect] |
| 58 | |
| 59 | [section Synopsis] |
| 60 | Library features defined in [@boost:boost/lexical_cast.hpp boost/lexical_cast.hpp]: |
| 61 | `` |
| 62 | namespace boost |
| 63 | { |
| 64 | class bad_lexical_cast; |
| 65 | |
| 66 | template<typename Target, typename Source> |
| 67 | Target lexical_cast(const Source& arg); |
| 68 | |
| 69 | template <typename Target> |
| 70 | Target lexical_cast(const AnyCharacterType* chars, std::size_t count); |
| 71 | |
| 72 | namespace conversion |
| 73 | { |
| 74 | template<typename Target, typename Source> |
| 75 | bool try_lexical_convert(const Source& arg, Target& result); |
| 76 | |
| 77 | template <typename AnyCharacterType, typename Target> |
| 78 | bool try_lexical_convert(const AnyCharacterType* chars, std::size_t count, Target& result); |
| 79 | |
| 80 | } // namespace conversion |
| 81 | } // namespace boost |
| 82 | `` |
| 83 | |
| 84 | [section lexical_cast] |
| 85 | `` |
| 86 | template<typename Target, typename Source> |
| 87 | Target lexical_cast(const Source& arg); |
| 88 | `` |
| 89 | Returns the result of streaming arg into a standard library string-based stream and then out as a Target object. Where Target is either `std::string` or `std::wstring`, stream extraction takes the whole content of the string, including spaces, rather than relying on the default `operator>>` behavior. If the conversion is unsuccessful, a `bad_lexical_cast` exception is thrown. |
| 90 | |
| 91 | `` |
| 92 | template <typename Target> |
| 93 | Target lexical_cast(const AnyCharacterType* chars, std::size_t count); |
| 94 | `` |
| 95 | Takes an array of `count` characters as input parameter and streams them out as a Target object. If the conversion is unsuccessful, a `bad_lexical_cast` exception is thrown. This call may be useful for processing nonzero terminated array of characters or processing just some part of character array. |
| 96 | |
| 97 | The requirements on the argument and result types for both functions are: |
| 98 | |
| 99 | * Source is OutputStreamable, meaning that an `operator<<` is defined that takes a `std::ostream` or `std::wostream` object on the left hand side and an instance of the argument type on the right. |
| 100 | * Target is InputStreamable, meaning that an `operator>>` is defined that takes a `std::istream` or `std::wistream` object on the left hand side and an instance of the result type on the right. |
| 101 | * Target is CopyConstructible [20.1.3]. |
| 102 | * Target is DefaultConstructible, meaning that it is possible to default-initialize an object of that type [8.5, 20.1.4]. |
| 103 | |
| 104 | The character type of the underlying stream is assumed to be `char` unless either the `Source` or the `Target` requires wide-character streaming, in which case the underlying stream uses `wchar_t`. Following types also can use `char16_t` or `char32_t` for wide-character streaming: |
| 105 | |
| 106 | * Single character: `char16_t`, `char32_t` |
| 107 | * Arrays of characters: `char16_t *`, `char32_t *`, `const char16_t *`, `const char32_t *` |
| 108 | * Strings: `std::basic_string`, `boost::containers::basic_string` |
| 109 | * `boost::iterator_range<WideCharPtr>`, where `WideCharPtr` is a pointer to wide-character or pointer to const wide-character |
| 110 | * `boost::array<CharT, N>` and `std::array<CharT, N>`, `boost::array<const CharT, N>` and `std::array<const CharT, N>` |
| 111 | |
| 112 | [important Many compilers and runtime libraries fail to make conversions using new Unicode characters. Make sure that the following code compiles and outputs nonzero values, before using new types: |
| 113 | `` |
| 114 | std::cout |
| 115 | << boost::lexical_cast<std::u32string>(1.0).size() |
| 116 | << " " |
| 117 | << boost::lexical_cast<std::u16string>(1.0).size(); |
| 118 | `` |
| 119 | ] |
| 120 | |
| 121 | Where a higher degree of control is required over conversions, `std::stringstream` and `std::wstringstream` offer a more appropriate path. Where non-stream-based conversions are required, `lexical_cast` is the wrong tool for the job and is not special-cased for such scenarios. |
| 122 | [endsect] |
| 123 | |
| 124 | [section bad_lexical_cast] |
| 125 | `` |
| 126 | class bad_lexical_cast : public std::bad_cast |
| 127 | { |
| 128 | public: |
| 129 | ... // same member function interface as std::exception |
| 130 | }; |
| 131 | `` |
| 132 | Exception used to indicate runtime lexical_cast failure. |
| 133 | [endsect] |
| 134 | |
| 135 | [section try_lexical_convert] |
| 136 | `boost::lexical_cast` remains the main interface for lexical conversions. It must be used by default in most cases. However |
| 137 | some developers wish to make their own conversion functions, reusing all the optimizations of the `boost::lexical_cast`. |
| 138 | That's where the `boost::conversion::try_lexical_convert` function steps in. |
| 139 | |
| 140 | `try_lexical_convert` returns `true` if conversion succeeded, otherwise returns `false`. If conversion |
| 141 | failed and `false` was returned, state of `result` output variable is undefined. |
| 142 | |
| 143 | Actually, `boost::lexical_cast` is implemented using `try_lexical_convert`: |
| 144 | `` |
| 145 | template <typename Target, typename Source> |
| 146 | inline Target lexical_cast(const Source &arg) |
| 147 | { |
| 148 | Target result; |
| 149 | |
| 150 | if (!conversion::try_lexical_convert(arg, result)) |
| 151 | throw bad_lexical_cast(); |
| 152 | |
| 153 | return result; |
| 154 | } |
| 155 | `` |
| 156 | |
| 157 | `try_lexical_convert` relaxes the CopyConstructible and DefaultConstructible requirements for `Target` type. |
| 158 | Following requirements for `Target` and `Source` remain: |
| 159 | |
| 160 | * Source must be OutputStreamable, meaning that an `operator<<` is defined that takes a `std::ostream` or `std::wostream` object on the left hand side and an instance of the argument type on the right. |
| 161 | * Target must be InputStreamable, meaning that an `operator>>` is defined that takes a `std::istream` or `std::wistream` object on the left hand side and an instance of the result type on the right. |
| 162 | |
| 163 | [endsect] |
| 164 | |
| 165 | |
| 166 | [endsect] |
| 167 | |
| 168 | [section Frequently Asked Questions] |
| 169 | |
| 170 | * [*Question:] Why does `lexical_cast<int8_t>("127")` throw `bad_lexical_cast`? |
| 171 | * [*Answer:] The type `int8_t` is a `typedef` to `char` or `signed char`. Lexical conversion to these types is simply reading a byte from source but since the source has more than one byte, the exception is thrown. |
| 172 | Please use other integer types such as `int` or `short int`. If bounds checking is important, you can also |
| 173 | call __numericcast__: |
| 174 | `numeric_cast<int8_t>(lexical_cast<int>("127"));` |
| 175 | |
| 176 | [pre |
| 177 | ] |
| 178 | |
| 179 | * [*Question:] Why does `lexical_cast<unsigned char>("127")` throw `bad_lexical_cast`? |
| 180 | * [*Answer:] Lexical conversion to any char type is simply reading a byte from source. But since the source has more than one byte, the exception is thrown. |
| 181 | Please use other integer types such as `int` or `short int`. If bounds checking is important, you can also |
| 182 | call __numericcast__: |
| 183 | `numeric_cast<unsigned char>(lexical_cast<int>("127"));` |
| 184 | |
| 185 | [pre |
| 186 | ] |
| 187 | |
| 188 | * [*Question:] What does `lexical_cast<std::string>` of an `int8_t` or `uint8_t` not do what I expect? |
| 189 | * [*Answer:] As above, note that int8_t and uint8_t are actually chars and are formatted as such. To avoid |
| 190 | this, cast to an integer type first: `lexical_cast<std::string>(static_cast<int>(n));` |
| 191 | |
| 192 | [pre |
| 193 | ] |
| 194 | |
| 195 | * [*Question:] The implementation always resets the `ios_base::skipws` flag of an underlying stream object. |
| 196 | It breaks my `operator>>` that works only in presence of this flag. Can you remove code that resets the flag? |
| 197 | * [*Answer:] May be in a future version. There is no requirement in |
| 198 | __proposallong__ to reset the flag but |
| 199 | remember that __proposalshort__ is not yet accepted by the committee. By the way, it's a great opportunity to |
| 200 | make your `operator>>` more general. |
| 201 | Read a good C++ book, study `std::sentry` and [@boost:libs/io/doc/ios_state.html `ios_state_saver`]. |
| 202 | |
| 203 | [pre |
| 204 | ] |
| 205 | |
| 206 | * [*Question:] Why `std::cout << boost::lexical_cast<unsigned int>("-1");` does not throw, but outputs 4294967295? |
| 207 | * [*Answer:] `boost::lexical_cast` has the behavior of `std::stringstream`, which uses `num_get` functions of |
| 208 | `std::locale` to convert numbers. If we look at the Programming languages — C++, we'll see, that `num_get` uses |
| 209 | the rules of `scanf` for conversions. And in the C99 standard for unsigned input value minus sign is optional, so |
| 210 | if a negative number is read, no errors will arise and the result will be the two's complement. |
| 211 | |
| 212 | [pre |
| 213 | ] |
| 214 | |
| 215 | * [*Question:] Why `boost::lexical_cast<int>(L'A');` outputs 65 and `boost::lexical_cast<wchar_t>(L"65");` does not throw? |
| 216 | * [*Answer:] If you are using an old version of Visual Studio or compile code with /Zc:wchar_t- flag, |
| 217 | `boost::lexical_cast` sees single `wchar_t` character as `unsigned short`. It is not a `boost::lexical_cast` mistake, but a |
| 218 | limitation of compiler options that you use. |
| 219 | |
| 220 | [pre |
| 221 | ] |
| 222 | |
| 223 | * [*Question:] Why `boost::lexical_cast<double>("-1.#IND");` throws `boost::bad_lexical_cast`? |
| 224 | * [*Answer:] `"-1.#IND"` is a compiler extension, that violates standard. You shall input `"-nan"`, `"nan"`, `"inf"` |
| 225 | , `"-inf"` (case insensitive) strings to get NaN and Inf values. `boost::lexical_cast<string>` outputs `"-nan"`, `"nan"`, |
| 226 | `"inf"`, `"-inf"` strings, when has NaN or Inf input values. |
| 227 | |
| 228 | [pre |
| 229 | ] |
| 230 | |
| 231 | * [*Question:] What is the fastest way to convert a non zero terminated string or a substring using `boost::lexical_cast`? |
| 232 | * [*Answer:] Use `boost::iterator_range` for conversion or `lexical_cast` overload with two parameters. For example, if you whant to convert to `int` two characters from a string `str`, you shall write `lexical_cast<int>(make_iterator_range(str.data(), str.data() + 2));` or `lexical_cast<int>(str.data(), 2);`. |
| 233 | |
| 234 | [endsect] |
| 235 | |
| 236 | [section Changes] |
| 237 | |
| 238 | * [*boost 1.56.0 :] |
| 239 | |
| 240 | * Added `boost::conversion::try_lexical_convert` functions. |
| 241 | |
| 242 | * [*boost 1.54.0 :] |
| 243 | |
| 244 | * Fix some issues with `boost::int128_type` and `boost::uint128_type` conversions. Notify user at compile time |
| 245 | if the `std::numeric_limits` are not specialized for 128bit types and `boost::lexical_cast` can not make conversions. |
| 246 | |
| 247 | * [*boost 1.54.0 :] |
| 248 | |
| 249 | * Added code to convert `boost::int128_type` and `boost::uint128_type` types (requires GCC 4.7 or higher). |
| 250 | * Conversions to pointers will now fail to compile, instead of throwing at runtime. |
| 251 | * Restored ability to get pointers to `lexical_cast` function (was broken in 1.53.0). |
| 252 | |
| 253 | * [*boost 1.53.0 :] |
| 254 | |
| 255 | * Much better input and output streams detection for user defined types. |
| 256 | |
| 257 | * [*boost 1.52.0 :] |
| 258 | |
| 259 | * Restored compilation on MSVC-2003 (was broken in 1.51.0). |
| 260 | * Added `lexical_cast(const CharType* chars, std::size_t count)` function overload. |
| 261 | |
| 262 | * [*boost 1.51.0 :] |
| 263 | |
| 264 | * Better performance, less memory usage for `boost::array<character_type, N>` and `std::array<character_type, N>` conversions. |
| 265 | |
| 266 | * [*boost 1.50.0 :] |
| 267 | |
| 268 | * `boost::bad_lexical_cast` exception is now globaly visible and can be catched even if code is compiled with -fvisibility=hidden. |
| 269 | * Now it is possible to compile library with disabled exceptions. |
| 270 | * Better performance, less memory usage and bugfixes for `boost::iterator_range<character_type*>` conversions. |
| 271 | |
| 272 | * [*boost 1.49.0 :] |
| 273 | |
| 274 | * Restored work with typedefed wchar_t (compilation flag /Zc:wchar_t- for Visual Studio). |
| 275 | * Better performance and less memory usage for `boost::container::basic_string` conversions. |
| 276 | |
| 277 | * [*boost 1.48.0 :] |
| 278 | |
| 279 | * Added code to work with Inf and NaN on any platform. |
| 280 | * Better performance and less memory usage for conversions to float type (and to double type, if `sizeof(double) < sizeof(long double)`). |
| 281 | |
| 282 | * [*boost 1.47.0 :] |
| 283 | |
| 284 | * Optimizations for "C" and other locales without number grouping. |
| 285 | * Better performance and less memory usage for unsigned char and signed char conversions. |
| 286 | * Better performance and less memory usage for conversions to arithmetic types. |
| 287 | * Better performance and less memory usage for conversions from arithmetic type to arithmetic type. |
| 288 | * Directly construct Target from Source on some conversions (like conversions from string to string, from char array to string, from char to char and others). |
| 289 | |
| 290 | * [*boost 1.34.0 :] |
| 291 | |
| 292 | * Better performance for many combinations of Source and Target types. For more details refer to Alexander Nasonovs article [@http://accu.org/index.php/journals/1375 Fine Tuning for lexical_cast, Overload #74, August 2006] [@http://www.accu.org/var/uploads/journals/overload74.pdf (PDF)]. |
| 293 | |
| 294 | * [*boost 1.33.0 :] |
| 295 | |
| 296 | * Call-by-const reference for the parameters. This requires partial specialization of class templates, so it doesn't work for MSVC 6, and it uses the original pass by value there. |
| 297 | * The MSVC 6 support is deprecated, and will be removed in a future Boost version. |
| 298 | |
| 299 | * [*Earlier :] |
| 300 | |
| 301 | * The previous version of lexical_cast used the default stream precision for reading and writing floating-point numbers. For numerics that have a corresponding specialization of `std::numeric_limits`, the current version now chooses a precision to match. |
| 302 | * The previous version of lexical_cast did not support conversion to or from any wide-character-based types. For compilers with full language and library support for wide characters, `lexical_cast` now supports conversions from `wchar_t`, `wchar_t *`, and `std::wstring` and to `wchar_t` and `std::wstring`. |
| 303 | * The previous version of `lexical_cast` assumed that the conventional stream extractor operators were sufficient for reading values. However, string I/O is asymmetric, with the result that spaces play the role of I/O separators rather than string content. The current version fixes this error for `std::string` and, where supported, `std::wstring`: `lexical_cast<std::string>("Hello, World")` succeeds instead of failing with a `bad_lexical_cast` exception. |
| 304 | * The previous version of `lexical_cast` allowed unsafe and meaningless conversions to pointers. The current version now throws a `bad_lexical_cast` for conversions to pointers: `lexical_cast<char *>("Goodbye, World")` now throws an exception instead of causing undefined behavior. |
| 305 | |
| 306 | [endsect] |
| 307 | |
| 308 | [section Performance] |
| 309 | |
| 310 | In most cases `boost::lexical_cast` is faster than `scanf`, `printf`, `std::stringstream`. For more detailed info you can look at the tables below. |
| 311 | |
| 312 | [section Tests description] |
| 313 | All the tests measure execution speed in milliseconds for 10000 iterations of the following code blocks: |
| 314 | [table:legend Tests source code |
| 315 | [[Test name] [Code]] |
| 316 | [[lexical_cast] |
| 317 | [`` |
| 318 | _out = boost::lexical_cast<OUTTYPE>(_in); |
| 319 | ``] |
| 320 | ] |
| 321 | [[std::stringstream with construction] |
| 322 | [`` |
| 323 | std::stringstream ss; |
| 324 | ss << _in; |
| 325 | if (ss.fail()) throw std::logic_error(descr); |
| 326 | ss >> _out; |
| 327 | if (ss.fail()) throw std::logic_error(descr); |
| 328 | ``] |
| 329 | ] |
| 330 | [[std::stringstream without construction] |
| 331 | [`` |
| 332 | ss << _in; // ss is an instance of std::stringstream |
| 333 | if (ss.fail()) throw std::logic_error(descr); |
| 334 | ss >> _out; |
| 335 | if (ss.fail()) throw std::logic_error(descr); |
| 336 | /* reseting std::stringstream to use it again */ |
| 337 | ss.str(std::string()); |
| 338 | ss.clear(); |
| 339 | ``] |
| 340 | ] |
| 341 | [[scanf/printf] |
| 342 | [`` |
| 343 | typename OUTTYPE::value_type buffer[500]; |
| 344 | sprintf( (char*)buffer, conv, _in); |
| 345 | _out = buffer; |
| 346 | ``] |
| 347 | ] |
| 348 | ] |
| 349 | Fastest results are highlitened with "!!! *x* !!!". |
| 350 | Do not use this results to compare compilers, because tests were taken on different hardware. |
| 351 | |
| 352 | [endsect] |
| 353 | |
| 354 | [/ BEGIN of section, generated by performance measuring program ] |
| 355 | |
| 356 | |
| 357 | [section GNU C++ version 6.1.1 20160511] |
| 358 | [table:id Performance Table ( GNU C++ version 6.1.1 20160511) |
| 359 | [[From->To] [lexical_cast] [std::stringstream with construction] [std::stringstream without construction][scanf/printf]] |
| 360 | [[ string->char ][ !!! *<1* !!! ][ 59 ][ 4 ][ 4 ]] |
| 361 | [[ string->signed char ][ !!! *<1* !!! ][ 52 ][ 4 ][ 5 ]] |
| 362 | [[ string->unsigned char ][ !!! *<1* !!! ][ 54 ][ 4 ][ 5 ]] |
| 363 | [[ string->int ][ !!! *4* !!! ][ 61 ][ 19 ][ 12 ]] |
| 364 | [[ string->short ][ !!! *4* !!! ][ 59 ][ 11 ][ 8 ]] |
| 365 | [[ string->long int ][ !!! *4* !!! ][ 59 ][ 9 ][ 8 ]] |
| 366 | [[ string->long long ][ !!! *6* !!! ][ 61 ][ 10 ][ 10 ]] |
| 367 | [[ string->unsigned int ][ !!! *4* !!! ][ 59 ][ 9 ][ 9 ]] |
| 368 | [[ string->unsigned short ][ !!! *4* !!! ][ 60 ][ 9 ][ 8 ]] |
| 369 | [[ string->unsigned long int ][ !!! *4* !!! ][ 60 ][ 9 ][ 8 ]] |
| 370 | [[ string->unsigned long long ][ !!! *4* !!! ][ 70 ][ 21 ][ 21 ]] |
| 371 | [[ string->float ][ 91 ][ 152 ][ 59 ][ !!! *40* !!! ]] |
| 372 | [[ string->double ][ 86 ][ 140 ][ 58 ][ !!! *28* !!! ]] |
| 373 | [[ string->long double ][ 48 ][ 90 ][ 34 ][ !!! *22* !!! ]] |
| 374 | [[ string->array<char, 50> ][ !!! *<1* !!! ][ 59 ][ 9 ][ 10 ]] |
| 375 | [[ string->string ][ !!! *2* !!! ][ 129 ][ 29 ][ --- ]] |
| 376 | [[ string->container::string ][ !!! *1* !!! ][ 70 ][ 11 ][ --- ]] |
| 377 | [[ string->char ][ !!! *4* !!! ][ 99 ][ 27 ][ 20 ]] |
| 378 | [[ string->signed char ][ !!! *9* !!! ][ 101 ][ 13 ][ 12 ]] |
| 379 | [[ string->unsigned char ][ !!! *4* !!! ][ 86 ][ 27 ][ 27 ]] |
| 380 | [[ int->string ][ !!! *9* !!! ][ 89 ][ 17 ][ 14 ]] |
| 381 | [[ short->string ][ !!! *7* !!! ][ 71 ][ 17 ][ 15 ]] |
| 382 | [[ long int->string ][ !!! *7* !!! ][ 71 ][ 18 ][ 19 ]] |
| 383 | [[ long long->string ][ !!! *13* !!! ][ 127 ][ 34 ][ 25 ]] |
| 384 | [[ unsigned int->string ][ 16 ][ 117 ][ 17 ][ !!! *12* !!! ]] |
| 385 | [[ unsigned short->string ][ !!! *8* !!! ][ 71 ][ 16 ][ 12 ]] |
| 386 | [[ unsigned long int->string ][ !!! *12* !!! ][ 100 ][ 36 ][ 26 ]] |
| 387 | [[ unsigned long long->string ][ !!! *14* !!! ][ 97 ][ 21 ][ 17 ]] |
| 388 | [[ float->string ][ 70 ][ 97 ][ 43 ][ !!! *25* !!! ]] |
| 389 | [[ double->string ][ 130 ][ 155 ][ 51 ][ !!! *25* !!! ]] |
| 390 | [[ long double->string ][ 104 ][ 160 ][ !!! *47* !!! ][ 57 ]] |
| 391 | [[ char*->char ][ !!! *<1* !!! ][ 95 ][ 4 ][ 4 ]] |
| 392 | [[ char*->signed char ][ !!! *<1* !!! ][ 52 ][ 7 ][ 13 ]] |
| 393 | [[ char*->unsigned char ][ !!! *<1* !!! ][ 106 ][ 11 ][ 13 ]] |
| 394 | [[ char*->int ][ !!! *6* !!! ][ 118 ][ 22 ][ 21 ]] |
| 395 | [[ char*->short ][ !!! *7* !!! ][ 104 ][ 10 ][ 19 ]] |
| 396 | [[ char*->long int ][ !!! *8* !!! ][ 112 ][ 24 ][ 14 ]] |
| 397 | [[ char*->long long ][ !!! *4* !!! ][ 90 ][ 17 ][ 9 ]] |
| 398 | [[ char*->unsigned int ][ !!! *4* !!! ][ 103 ][ 23 ][ 22 ]] |
| 399 | [[ char*->unsigned short ][ !!! *7* !!! ][ 82 ][ 9 ][ 8 ]] |
| 400 | [[ char*->unsigned long int ][ !!! *5* !!! ][ 58 ][ 20 ][ 8 ]] |
| 401 | [[ char*->unsigned long long ][ !!! *4* !!! ][ 60 ][ 10 ][ 11 ]] |
| 402 | [[ char*->float ][ 58 ][ 103 ][ !!! *32* !!! ][ 37 ]] |
| 403 | [[ char*->double ][ 52 ][ 155 ][ 32 ][ !!! *27* !!! ]] |
| 404 | [[ char*->long double ][ 72 ][ 135 ][ 51 ][ !!! *30* !!! ]] |
| 405 | [[ char*->array<char, 50> ][ !!! *<1* !!! ][ 80 ][ 23 ][ 17 ]] |
| 406 | [[ char*->string ][ !!! *10* !!! ][ 150 ][ 18 ][ --- ]] |
| 407 | [[ char*->container::string ][ !!! *<1* !!! ][ 64 ][ 11 ][ --- ]] |
| 408 | [[ unsigned char*->char ][ !!! *<1* !!! ][ 52 ][ 4 ][ 4 ]] |
| 409 | [[ unsigned char*->signed char ][ !!! *<1* !!! ][ 54 ][ 4 ][ 5 ]] |
| 410 | [[ unsigned char*->unsigned char ][ !!! *<1* !!! ][ 54 ][ 4 ][ 5 ]] |
| 411 | [[ unsigned char*->int ][ !!! *4* !!! ][ 59 ][ 10 ][ 8 ]] |
| 412 | [[ unsigned char*->short ][ !!! *4* !!! ][ 59 ][ 10 ][ 8 ]] |
| 413 | [[ unsigned char*->long int ][ !!! *4* !!! ][ 66 ][ 24 ][ 19 ]] |
| 414 | [[ unsigned char*->long long ][ !!! *4* !!! ][ 59 ][ 10 ][ 8 ]] |
| 415 | [[ unsigned char*->unsigned int ][ !!! *4* !!! ][ 79 ][ 24 ][ 22 ]] |
| 416 | [[ unsigned char*->unsigned short ][ !!! *7* !!! ][ 123 ][ 23 ][ 22 ]] |
| 417 | [[ unsigned char*->unsigned long int ][ !!! *8* !!! ][ 121 ][ 24 ][ 22 ]] |
| 418 | [[ unsigned char*->unsigned long long ][ !!! *8* !!! ][ 121 ][ 24 ][ 22 ]] |
| 419 | [[ unsigned char*->float ][ 97 ][ 167 ][ 67 ][ !!! *47* !!! ]] |
| 420 | [[ unsigned char*->double ][ 96 ][ 164 ][ 67 ][ !!! *47* !!! ]] |
| 421 | [[ unsigned char*->long double ][ 97 ][ 165 ][ 66 ][ !!! *47* !!! ]] |
| 422 | [[ unsigned char*->array<char, 50> ][ !!! *<1* !!! ][ 119 ][ 22 ][ 17 ]] |
| 423 | [[ unsigned char*->string ][ !!! *11* !!! ][ 139 ][ 34 ][ --- ]] |
| 424 | [[ unsigned char*->container::string ][ !!! *1* !!! ][ 121 ][ 25 ][ --- ]] |
| 425 | [[ signed char*->char ][ !!! *<1* !!! ][ 106 ][ 11 ][ 8 ]] |
| 426 | [[ signed char*->signed char ][ !!! *<1* !!! ][ 81 ][ 12 ][ 13 ]] |
| 427 | [[ signed char*->unsigned char ][ !!! *<1* !!! ][ 109 ][ 11 ][ 12 ]] |
| 428 | [[ signed char*->int ][ !!! *7* !!! ][ 122 ][ 24 ][ 21 ]] |
| 429 | [[ signed char*->short ][ !!! *4* !!! ][ 59 ][ 10 ][ 8 ]] |
| 430 | [[ signed char*->long int ][ !!! *4* !!! ][ 60 ][ 10 ][ 8 ]] |
| 431 | [[ signed char*->long long ][ !!! *4* !!! ][ 60 ][ 10 ][ 8 ]] |
| 432 | [[ signed char*->unsigned int ][ !!! *4* !!! ][ 64 ][ 23 ][ 22 ]] |
| 433 | [[ signed char*->unsigned short ][ !!! *7* !!! ][ 120 ][ 24 ][ 22 ]] |
| 434 | [[ signed char*->unsigned long int ][ !!! *8* !!! ][ 121 ][ 24 ][ 22 ]] |
| 435 | [[ signed char*->unsigned long long ][ !!! *8* !!! ][ 122 ][ 23 ][ 22 ]] |
| 436 | [[ signed char*->float ][ 95 ][ 165 ][ 68 ][ !!! *46* !!! ]] |
| 437 | [[ signed char*->double ][ 95 ][ 161 ][ 66 ][ !!! *47* !!! ]] |
| 438 | [[ signed char*->long double ][ 96 ][ 161 ][ 66 ][ !!! *46* !!! ]] |
| 439 | [[ signed char*->array<char, 50> ][ !!! *<1* !!! ][ 117 ][ 22 ][ 17 ]] |
| 440 | [[ signed char*->string ][ !!! *10* !!! ][ 84 ][ 15 ][ --- ]] |
| 441 | [[ signed char*->container::string ][ !!! *1* !!! ][ 119 ][ 25 ][ --- ]] |
| 442 | [[ iterator_range<char*>->char ][ !!! *<1* !!! ][ 111 ][ 16 ][ 11 ]] |
| 443 | [[ iterator_range<char*>->signed char ][ !!! *<1* !!! ][ 110 ][ 16 ][ 13 ]] |
| 444 | [[ iterator_range<char*>->unsigned char ][ !!! *<1* !!! ][ 111 ][ 15 ][ 13 ]] |
| 445 | [[ iterator_range<char*>->int ][ !!! *6* !!! ][ 119 ][ 25 ][ 22 ]] |
| 446 | [[ iterator_range<char*>->short ][ !!! *7* !!! ][ 119 ][ 25 ][ 22 ]] |
| 447 | [[ iterator_range<char*>->long int ][ !!! *7* !!! ][ 120 ][ 25 ][ 22 ]] |
| 448 | [[ iterator_range<char*>->long long ][ !!! *8* !!! ][ 119 ][ 24 ][ 22 ]] |
| 449 | [[ iterator_range<char*>->unsigned int ][ !!! *6* !!! ][ 119 ][ 24 ][ 22 ]] |
| 450 | [[ iterator_range<char*>->unsigned short ][ !!! *6* !!! ][ 117 ][ 24 ][ 22 ]] |
| 451 | [[ iterator_range<char*>->unsigned long int ][ !!! *7* !!! ][ 120 ][ 24 ][ 22 ]] |
| 452 | [[ iterator_range<char*>->unsigned long long ][ !!! *8* !!! ][ 118 ][ 24 ][ 22 ]] |
| 453 | [[ iterator_range<char*>->float ][ 96 ][ 155 ][ 48 ][ !!! *47* !!! ]] |
| 454 | [[ iterator_range<char*>->double ][ 96 ][ 141 ][ 47 ][ !!! *47* !!! ]] |
| 455 | [[ iterator_range<char*>->long double ][ 96 ][ 140 ][ 46 ][ !!! *46* !!! ]] |
| 456 | [[ iterator_range<char*>->array<char, 50> ][ !!! *<1* !!! ][ 118 ][ 25 ][ 17 ]] |
| 457 | [[ iterator_range<char*>->string ][ !!! *10* !!! ][ 136 ][ 35 ][ --- ]] |
| 458 | [[ iterator_range<char*>->container::string ][ !!! *1* !!! ][ 119 ][ 26 ][ --- ]] |
| 459 | [[ array<char, 50>->char ][ !!! *<1* !!! ][ 108 ][ 11 ][ 10 ]] |
| 460 | [[ array<char, 50>->signed char ][ !!! *<1* !!! ][ 106 ][ 12 ][ 12 ]] |
| 461 | [[ array<char, 50>->unsigned char ][ !!! *<1* !!! ][ 107 ][ 11 ][ 13 ]] |
| 462 | [[ array<char, 50>->int ][ !!! *6* !!! ][ 119 ][ 24 ][ 22 ]] |
| 463 | [[ array<char, 50>->short ][ !!! *7* !!! ][ 121 ][ 24 ][ 22 ]] |
| 464 | [[ array<char, 50>->long int ][ !!! *7* !!! ][ 119 ][ 24 ][ 22 ]] |
| 465 | [[ array<char, 50>->long long ][ !!! *7* !!! ][ 123 ][ 24 ][ 22 ]] |
| 466 | [[ array<char, 50>->unsigned int ][ !!! *7* !!! ][ 121 ][ 23 ][ 25 ]] |
| 467 | [[ array<char, 50>->unsigned short ][ !!! *6* !!! ][ 120 ][ 24 ][ 22 ]] |
| 468 | [[ array<char, 50>->unsigned long int ][ !!! *7* !!! ][ 59 ][ 10 ][ 9 ]] |
| 469 | [[ array<char, 50>->unsigned long long ][ !!! *4* !!! ][ 60 ][ 10 ][ 8 ]] |
| 470 | [[ array<char, 50>->float ][ 47 ][ 80 ][ 32 ][ !!! *22* !!! ]] |
| 471 | [[ array<char, 50>->double ][ 46 ][ 82 ][ 31 ][ !!! *22* !!! ]] |
| 472 | [[ array<char, 50>->long double ][ 49 ][ 82 ][ 31 ][ !!! *22* !!! ]] |
| 473 | [[ array<char, 50>->array<char, 50> ][ !!! *1* !!! ][ 59 ][ 9 ][ 7 ]] |
| 474 | [[ array<char, 50>->string ][ !!! *5* !!! ][ 70 ][ 15 ][ --- ]] |
| 475 | [[ array<char, 50>->container::string ][ !!! *1* !!! ][ 60 ][ 11 ][ --- ]] |
| 476 | [[ int->int ][ !!! *<1* !!! ][ 61 ][ 12 ][ --- ]] |
| 477 | [[ float->double ][ !!! *<1* !!! ][ 111 ][ 54 ][ --- ]] |
| 478 | [[ char->signed char ][ !!! *<1* !!! ][ 51 ][ 4 ][ --- ]] |
| 479 | ] |
| 480 | [endsect] |
| 481 | |
| 482 | [section GNU C++ version 4.8.5] |
| 483 | [table:id Performance Table ( GNU C++ version 4.8.5) |
| 484 | [[From->To] [lexical_cast] [std::stringstream with construction] [std::stringstream without construction][scanf/printf]] |
| 485 | [[ string->char ][ !!! *<1* !!! ][ 100 ][ 10 ][ 10 ]] |
| 486 | [[ string->signed char ][ !!! *<1* !!! ][ 97 ][ 9 ][ 11 ]] |
| 487 | [[ string->unsigned char ][ !!! *<1* !!! ][ 103 ][ 11 ][ 13 ]] |
| 488 | [[ string->int ][ !!! *6* !!! ][ 122 ][ 23 ][ 22 ]] |
| 489 | [[ string->short ][ !!! *6* !!! ][ 116 ][ 23 ][ 22 ]] |
| 490 | [[ string->long int ][ !!! *6* !!! ][ 97 ][ 21 ][ 22 ]] |
| 491 | [[ string->long long ][ !!! *7* !!! ][ 118 ][ 22 ][ 22 ]] |
| 492 | [[ string->unsigned int ][ !!! *6* !!! ][ 116 ][ 22 ][ 22 ]] |
| 493 | [[ string->unsigned short ][ !!! *6* !!! ][ 106 ][ 9 ][ 8 ]] |
| 494 | [[ string->unsigned long int ][ !!! *3* !!! ][ 59 ][ 9 ][ 8 ]] |
| 495 | [[ string->unsigned long long ][ !!! *3* !!! ][ 58 ][ 9 ][ 8 ]] |
| 496 | [[ string->float ][ 88 ][ 166 ][ 70 ][ !!! *47* !!! ]] |
| 497 | [[ string->double ][ 102 ][ 162 ][ 65 ][ !!! *51* !!! ]] |
| 498 | [[ string->long double ][ 96 ][ 163 ][ 71 ][ !!! *46* !!! ]] |
| 499 | [[ string->array<char, 50> ][ !!! *1* !!! ][ 112 ][ 21 ][ 18 ]] |
| 500 | [[ string->string ][ !!! *2* !!! ][ 139 ][ 37 ][ --- ]] |
| 501 | [[ string->container::string ][ !!! *1* !!! ][ 121 ][ 24 ][ --- ]] |
| 502 | [[ string->char ][ !!! *9* !!! ][ 121 ][ 31 ][ 21 ]] |
| 503 | [[ string->signed char ][ !!! *9* !!! ][ 121 ][ 31 ][ 34 ]] |
| 504 | [[ string->unsigned char ][ !!! *9* !!! ][ 120 ][ 31 ][ 30 ]] |
| 505 | [[ int->string ][ !!! *17* !!! ][ 141 ][ 39 ][ 30 ]] |
| 506 | [[ short->string ][ !!! *18* !!! ][ 142 ][ 39 ][ 30 ]] |
| 507 | [[ long int->string ][ 17 ][ 136 ][ 17 ][ !!! *12* !!! ]] |
| 508 | [[ long long->string ][ !!! *7* !!! ][ 69 ][ 17 ][ 13 ]] |
| 509 | [[ unsigned int->string ][ !!! *8* !!! ][ 70 ][ 24 ][ 13 ]] |
| 510 | [[ unsigned short->string ][ !!! *7* !!! ][ 69 ][ 17 ][ 12 ]] |
| 511 | [[ unsigned long int->string ][ !!! *7* !!! ][ 71 ][ 16 ][ 12 ]] |
| 512 | [[ unsigned long long->string ][ !!! *7* !!! ][ 71 ][ 16 ][ 12 ]] |
| 513 | [[ float->string ][ 60 ][ 95 ][ 49 ][ !!! *24* !!! ]] |
| 514 | [[ double->string ][ 68 ][ 97 ][ 45 ][ !!! *26* !!! ]] |
| 515 | [[ long double->string ][ 72 ][ 108 ][ 45 ][ !!! *28* !!! ]] |
| 516 | [[ char*->char ][ !!! *<1* !!! ][ 52 ][ 5 ][ 4 ]] |
| 517 | [[ char*->signed char ][ !!! *<1* !!! ][ 52 ][ 5 ][ 5 ]] |
| 518 | [[ char*->unsigned char ][ !!! *<1* !!! ][ 52 ][ 5 ][ 5 ]] |
| 519 | [[ char*->int ][ !!! *3* !!! ][ 60 ][ 10 ][ 8 ]] |
| 520 | [[ char*->short ][ !!! *3* !!! ][ 61 ][ 10 ][ 8 ]] |
| 521 | [[ char*->long int ][ !!! *4* !!! ][ 60 ][ 10 ][ 8 ]] |
| 522 | [[ char*->long long ][ !!! *4* !!! ][ 61 ][ 9 ][ 8 ]] |
| 523 | [[ char*->unsigned int ][ !!! *3* !!! ][ 103 ][ 13 ][ 8 ]] |
| 524 | [[ char*->unsigned short ][ !!! *3* !!! ][ 97 ][ 23 ][ 22 ]] |
| 525 | [[ char*->unsigned long int ][ !!! *7* !!! ][ 123 ][ 23 ][ 22 ]] |
| 526 | [[ char*->unsigned long long ][ !!! *6* !!! ][ 72 ][ 10 ][ 8 ]] |
| 527 | [[ char*->float ][ 85 ][ 160 ][ 66 ][ !!! *47* !!! ]] |
| 528 | [[ char*->double ][ 94 ][ 161 ][ 65 ][ !!! *46* !!! ]] |
| 529 | [[ char*->long double ][ 94 ][ 172 ][ 64 ][ !!! *47* !!! ]] |
| 530 | [[ char*->array<char, 50> ][ !!! *2* !!! ][ 113 ][ 22 ][ 16 ]] |
| 531 | [[ char*->string ][ !!! *10* !!! ][ 145 ][ 34 ][ --- ]] |
| 532 | [[ char*->container::string ][ !!! *1* !!! ][ 120 ][ 25 ][ --- ]] |
| 533 | [[ unsigned char*->char ][ !!! *<1* !!! ][ 102 ][ 11 ][ 10 ]] |
| 534 | [[ unsigned char*->signed char ][ !!! *<1* !!! ][ 100 ][ 12 ][ 12 ]] |
| 535 | [[ unsigned char*->unsigned char ][ !!! *<1* !!! ][ 102 ][ 11 ][ 12 ]] |
| 536 | [[ unsigned char*->int ][ !!! *7* !!! ][ 119 ][ 24 ][ 22 ]] |
| 537 | [[ unsigned char*->short ][ !!! *7* !!! ][ 120 ][ 24 ][ 22 ]] |
| 538 | [[ unsigned char*->long int ][ !!! *7* !!! ][ 119 ][ 24 ][ 23 ]] |
| 539 | [[ unsigned char*->long long ][ !!! *7* !!! ][ 119 ][ 24 ][ 22 ]] |
| 540 | [[ unsigned char*->unsigned int ][ !!! *6* !!! ][ 82 ][ 9 ][ 8 ]] |
| 541 | [[ unsigned char*->unsigned short ][ !!! *3* !!! ][ 58 ][ 9 ][ 8 ]] |
| 542 | [[ unsigned char*->unsigned long int ][ !!! *4* !!! ][ 59 ][ 10 ][ 10 ]] |
| 543 | [[ unsigned char*->unsigned long long ][ !!! *4* !!! ][ 60 ][ 12 ][ 8 ]] |
| 544 | [[ unsigned char*->float ][ 47 ][ 80 ][ 32 ][ !!! *22* !!! ]] |
| 545 | [[ unsigned char*->double ][ 47 ][ 79 ][ 31 ][ !!! *23* !!! ]] |
| 546 | [[ unsigned char*->long double ][ 47 ][ 80 ][ 31 ][ !!! *22* !!! ]] |
| 547 | [[ unsigned char*->array<char, 50> ][ !!! *1* !!! ][ 58 ][ 9 ][ 7 ]] |
| 548 | [[ unsigned char*->string ][ !!! *4* !!! ][ 68 ][ 15 ][ --- ]] |
| 549 | [[ unsigned char*->container::string ][ !!! *<1* !!! ][ 60 ][ 10 ][ --- ]] |
| 550 | [[ signed char*->char ][ !!! *<1* !!! ][ 52 ][ 5 ][ 4 ]] |
| 551 | [[ signed char*->signed char ][ !!! *<1* !!! ][ 54 ][ 4 ][ 5 ]] |
| 552 | [[ signed char*->unsigned char ][ !!! *<1* !!! ][ 52 ][ 4 ][ 6 ]] |
| 553 | [[ signed char*->int ][ !!! *6* !!! ][ 59 ][ 10 ][ 8 ]] |
| 554 | [[ signed char*->short ][ !!! *3* !!! ][ 59 ][ 10 ][ 8 ]] |
| 555 | [[ signed char*->long int ][ !!! *4* !!! ][ 60 ][ 10 ][ 8 ]] |
| 556 | [[ signed char*->long long ][ !!! *4* !!! ][ 59 ][ 10 ][ 9 ]] |
| 557 | [[ signed char*->unsigned int ][ !!! *3* !!! ][ 58 ][ 9 ][ 8 ]] |
| 558 | [[ signed char*->unsigned short ][ !!! *4* !!! ][ 58 ][ 9 ][ 8 ]] |
| 559 | [[ signed char*->unsigned long int ][ !!! *4* !!! ][ 59 ][ 10 ][ 8 ]] |
| 560 | [[ signed char*->unsigned long long ][ !!! *4* !!! ][ 59 ][ 10 ][ 8 ]] |
| 561 | [[ signed char*->float ][ 47 ][ 81 ][ 32 ][ !!! *25* !!! ]] |
| 562 | [[ signed char*->double ][ 46 ][ 79 ][ 31 ][ !!! *22* !!! ]] |
| 563 | [[ signed char*->long double ][ 48 ][ 80 ][ 32 ][ !!! *22* !!! ]] |
| 564 | [[ signed char*->array<char, 50> ][ !!! *1* !!! ][ 63 ][ 9 ][ 7 ]] |
| 565 | [[ signed char*->string ][ !!! *4* !!! ][ 68 ][ 15 ][ --- ]] |
| 566 | [[ signed char*->container::string ][ !!! *<1* !!! ][ 58 ][ 10 ][ --- ]] |
| 567 | [[ iterator_range<char*>->char ][ !!! *<1* !!! ][ 54 ][ 6 ][ 4 ]] |
| 568 | [[ iterator_range<char*>->signed char ][ !!! *<1* !!! ][ 57 ][ 6 ][ 5 ]] |
| 569 | [[ iterator_range<char*>->unsigned char ][ !!! *<1* !!! ][ 54 ][ 6 ][ 5 ]] |
| 570 | [[ iterator_range<char*>->int ][ !!! *3* !!! ][ 59 ][ 10 ][ 8 ]] |
| 571 | [[ iterator_range<char*>->short ][ !!! *3* !!! ][ 59 ][ 11 ][ 9 ]] |
| 572 | [[ iterator_range<char*>->long int ][ !!! *3* !!! ][ 61 ][ 11 ][ 8 ]] |
| 573 | [[ iterator_range<char*>->long long ][ !!! *3* !!! ][ 59 ][ 10 ][ 9 ]] |
| 574 | [[ iterator_range<char*>->unsigned int ][ !!! *3* !!! ][ 57 ][ 9 ][ 8 ]] |
| 575 | [[ iterator_range<char*>->unsigned short ][ !!! *3* !!! ][ 59 ][ 10 ][ 8 ]] |
| 576 | [[ iterator_range<char*>->unsigned long int ][ !!! *3* !!! ][ 58 ][ 10 ][ 8 ]] |
| 577 | [[ iterator_range<char*>->unsigned long long ][ !!! *3* !!! ][ 58 ][ 15 ][ 8 ]] |
| 578 | [[ iterator_range<char*>->float ][ 46 ][ 78 ][ 22 ][ !!! *22* !!! ]] |
| 579 | [[ iterator_range<char*>->double ][ 94 ][ 85 ][ !!! *21* !!! ][ 22 ]] |
| 580 | [[ iterator_range<char*>->long double ][ 47 ][ 79 ][ 33 ][ !!! *22* !!! ]] |
| 581 | [[ iterator_range<char*>->array<char, 50> ][ !!! *1* !!! ][ 102 ][ 25 ][ 16 ]] |
| 582 | [[ iterator_range<char*>->string ][ !!! *10* !!! ][ 96 ][ 16 ][ --- ]] |
| 583 | [[ iterator_range<char*>->container::string ][ !!! *<1* !!! ][ 64 ][ 11 ][ --- ]] |
| 584 | [[ array<char, 50>->char ][ !!! *<1* !!! ][ 75 ][ 4 ][ 4 ]] |
| 585 | [[ array<char, 50>->signed char ][ !!! *<1* !!! ][ 54 ][ 6 ][ 13 ]] |
| 586 | [[ array<char, 50>->unsigned char ][ !!! *<1* !!! ][ 103 ][ 12 ][ 12 ]] |
| 587 | [[ array<char, 50>->int ][ !!! *6* !!! ][ 121 ][ 25 ][ 23 ]] |
| 588 | [[ array<char, 50>->short ][ !!! *7* !!! ][ 122 ][ 24 ][ 22 ]] |
| 589 | [[ array<char, 50>->long int ][ !!! *7* !!! ][ 119 ][ 24 ][ 22 ]] |
| 590 | [[ array<char, 50>->long long ][ !!! *7* !!! ][ 120 ][ 24 ][ 22 ]] |
| 591 | [[ array<char, 50>->unsigned int ][ !!! *6* !!! ][ 121 ][ 23 ][ 22 ]] |
| 592 | [[ array<char, 50>->unsigned short ][ !!! *6* !!! ][ 121 ][ 23 ][ 22 ]] |
| 593 | [[ array<char, 50>->unsigned long int ][ !!! *6* !!! ][ 118 ][ 24 ][ 20 ]] |
| 594 | [[ array<char, 50>->unsigned long long ][ !!! *6* !!! ][ 109 ][ 22 ][ 21 ]] |
| 595 | [[ array<char, 50>->float ][ 93 ][ 150 ][ 61 ][ !!! *43* !!! ]] |
| 596 | [[ array<char, 50>->double ][ 89 ][ 147 ][ 61 ][ !!! *43* !!! ]] |
| 597 | [[ array<char, 50>->long double ][ 91 ][ 148 ][ 61 ][ !!! *42* !!! ]] |
| 598 | [[ array<char, 50>->array<char, 50> ][ !!! *2* !!! ][ 106 ][ 21 ][ 15 ]] |
| 599 | [[ array<char, 50>->string ][ !!! *10* !!! ][ 124 ][ 32 ][ --- ]] |
| 600 | [[ array<char, 50>->container::string ][ !!! *1* !!! ][ 109 ][ 23 ][ --- ]] |
| 601 | [[ int->int ][ !!! *<1* !!! ][ 114 ][ 26 ][ --- ]] |
| 602 | [[ float->double ][ !!! *<1* !!! ][ 207 ][ 105 ][ --- ]] |
| 603 | [[ char->signed char ][ !!! *<1* !!! ][ 97 ][ 10 ][ --- ]] |
| 604 | ] |
| 605 | [endsect] |
| 606 | |
| 607 | [section Clang version 3.6.0 (tags/RELEASE_360/final)] |
| 608 | [table:id Performance Table ( Clang version 3.6.0 (tags/RELEASE_360/final)) |
| 609 | [[From->To] [lexical_cast] [std::stringstream with construction] [std::stringstream without construction][scanf/printf]] |
| 610 | [[ string->char ][ !!! *<1* !!! ][ 79 ][ 4 ][ 4 ]] |
| 611 | [[ string->signed char ][ !!! *<1* !!! ][ 51 ][ 4 ][ 5 ]] |
| 612 | [[ string->unsigned char ][ !!! *<1* !!! ][ 51 ][ 4 ][ 5 ]] |
| 613 | [[ string->int ][ !!! *3* !!! ][ 80 ][ 22 ][ 22 ]] |
| 614 | [[ string->short ][ !!! *6* !!! ][ 108 ][ 22 ][ 22 ]] |
| 615 | [[ string->long int ][ !!! *6* !!! ][ 66 ][ 10 ][ 11 ]] |
| 616 | [[ string->long long ][ !!! *6* !!! ][ 101 ][ 9 ][ 20 ]] |
| 617 | [[ string->unsigned int ][ !!! *5* !!! ][ 77 ][ 8 ][ 8 ]] |
| 618 | [[ string->unsigned short ][ !!! *3* !!! ][ 61 ][ 8 ][ 8 ]] |
| 619 | [[ string->unsigned long int ][ !!! *5* !!! ][ 87 ][ 9 ][ 9 ]] |
| 620 | [[ string->unsigned long long ][ !!! *3* !!! ][ 89 ][ 9 ][ 8 ]] |
| 621 | [[ string->float ][ 52 ][ 114 ][ 38 ][ !!! *22* !!! ]] |
| 622 | [[ string->double ][ 49 ][ 79 ][ 32 ][ !!! *22* !!! ]] |
| 623 | [[ string->long double ][ 83 ][ 160 ][ 65 ][ !!! *47* !!! ]] |
| 624 | [[ string->array<char, 50> ][ !!! *<1* !!! ][ 114 ][ 21 ][ 16 ]] |
| 625 | [[ string->string ][ !!! *2* !!! ][ 78 ][ 34 ][ --- ]] |
| 626 | [[ string->container::string ][ !!! *1* !!! ][ 100 ][ 11 ][ --- ]] |
| 627 | [[ string->char ][ !!! *4* !!! ][ 60 ][ 16 ][ 7 ]] |
| 628 | [[ string->signed char ][ !!! *5* !!! ][ 70 ][ 30 ][ 30 ]] |
| 629 | [[ string->unsigned char ][ !!! *10* !!! ][ 119 ][ 31 ][ 30 ]] |
| 630 | [[ int->string ][ !!! *17* !!! ][ 140 ][ 38 ][ 28 ]] |
| 631 | [[ short->string ][ !!! *17* !!! ][ 139 ][ 38 ][ 29 ]] |
| 632 | [[ long int->string ][ !!! *17* !!! ][ 139 ][ 37 ][ 29 ]] |
| 633 | [[ long long->string ][ !!! *18* !!! ][ 138 ][ 37 ][ 30 ]] |
| 634 | [[ unsigned int->string ][ !!! *17* !!! ][ 138 ][ 37 ][ 29 ]] |
| 635 | [[ unsigned short->string ][ !!! *17* !!! ][ 139 ][ 38 ][ 29 ]] |
| 636 | [[ unsigned long int->string ][ !!! *17* !!! ][ 142 ][ 37 ][ 29 ]] |
| 637 | [[ unsigned long long->string ][ !!! *8* !!! ][ 71 ][ 16 ][ 28 ]] |
| 638 | [[ float->string ][ 68 ][ 97 ][ 42 ][ !!! *38* !!! ]] |
| 639 | [[ double->string ][ 68 ][ 134 ][ 43 ][ !!! *25* !!! ]] |
| 640 | [[ long double->string ][ 72 ][ 164 ][ 91 ][ !!! *55* !!! ]] |
| 641 | [[ char*->char ][ !!! *<1* !!! ][ 76 ][ 4 ][ 5 ]] |
| 642 | [[ char*->signed char ][ !!! *<1* !!! ][ 54 ][ 5 ][ 5 ]] |
| 643 | [[ char*->unsigned char ][ !!! *<1* !!! ][ 55 ][ 4 ][ 5 ]] |
| 644 | [[ char*->int ][ !!! *3* !!! ][ 60 ][ 10 ][ 8 ]] |
| 645 | [[ char*->short ][ !!! *3* !!! ][ 61 ][ 9 ][ 8 ]] |
| 646 | [[ char*->long int ][ !!! *4* !!! ][ 61 ][ 9 ][ 8 ]] |
| 647 | [[ char*->long long ][ !!! *3* !!! ][ 60 ][ 9 ][ 8 ]] |
| 648 | [[ char*->unsigned int ][ !!! *3* !!! ][ 59 ][ 8 ][ 9 ]] |
| 649 | [[ char*->unsigned short ][ !!! *3* !!! ][ 59 ][ 10 ][ 8 ]] |
| 650 | [[ char*->unsigned long int ][ !!! *3* !!! ][ 59 ][ 10 ][ 8 ]] |
| 651 | [[ char*->unsigned long long ][ !!! *3* !!! ][ 59 ][ 10 ][ 8 ]] |
| 652 | [[ char*->float ][ 48 ][ 80 ][ 32 ][ !!! *25* !!! ]] |
| 653 | [[ char*->double ][ 48 ][ 81 ][ 32 ][ !!! *22* !!! ]] |
| 654 | [[ char*->long double ][ 48 ][ 90 ][ 31 ][ !!! *22* !!! ]] |
| 655 | [[ char*->array<char, 50> ][ !!! *<1* !!! ][ 59 ][ 9 ][ 7 ]] |
| 656 | [[ char*->string ][ !!! *4* !!! ][ 77 ][ 15 ][ --- ]] |
| 657 | [[ char*->container::string ][ !!! *1* !!! ][ 62 ][ 12 ][ --- ]] |
| 658 | [[ unsigned char*->char ][ !!! *<1* !!! ][ 54 ][ 4 ][ 5 ]] |
| 659 | [[ unsigned char*->signed char ][ !!! *<1* !!! ][ 53 ][ 4 ][ 5 ]] |
| 660 | [[ unsigned char*->unsigned char ][ !!! *<1* !!! ][ 57 ][ 4 ][ 5 ]] |
| 661 | [[ unsigned char*->int ][ !!! *3* !!! ][ 63 ][ 24 ][ 24 ]] |
| 662 | [[ unsigned char*->short ][ !!! *5* !!! ][ 65 ][ 9 ][ 9 ]] |
| 663 | [[ unsigned char*->long int ][ !!! *3* !!! ][ 60 ][ 10 ][ 8 ]] |
| 664 | [[ unsigned char*->long long ][ !!! *4* !!! ][ 67 ][ 23 ][ 23 ]] |
| 665 | [[ unsigned char*->unsigned int ][ !!! *5* !!! ][ 116 ][ 23 ][ 22 ]] |
| 666 | [[ unsigned char*->unsigned short ][ !!! *5* !!! ][ 114 ][ 22 ][ 22 ]] |
| 667 | [[ unsigned char*->unsigned long int ][ !!! *6* !!! ][ 118 ][ 23 ][ 22 ]] |
| 668 | [[ unsigned char*->unsigned long long ][ !!! *6* !!! ][ 116 ][ 23 ][ 22 ]] |
| 669 | [[ unsigned char*->float ][ 93 ][ 160 ][ 66 ][ !!! *47* !!! ]] |
| 670 | [[ unsigned char*->double ][ 93 ][ 158 ][ 64 ][ !!! *46* !!! ]] |
| 671 | [[ unsigned char*->long double ][ 93 ][ 158 ][ 64 ][ !!! *46* !!! ]] |
| 672 | [[ unsigned char*->array<char, 50> ][ !!! *<1* !!! ][ 112 ][ 21 ][ 17 ]] |
| 673 | [[ unsigned char*->string ][ !!! *10* !!! ][ 136 ][ 33 ][ --- ]] |
| 674 | [[ unsigned char*->container::string ][ !!! *<1* !!! ][ 117 ][ 26 ][ --- ]] |
| 675 | [[ signed char*->char ][ !!! *<1* !!! ][ 102 ][ 11 ][ 10 ]] |
| 676 | [[ signed char*->signed char ][ !!! *<1* !!! ][ 102 ][ 11 ][ 12 ]] |
| 677 | [[ signed char*->unsigned char ][ !!! *<1* !!! ][ 102 ][ 11 ][ 12 ]] |
| 678 | [[ signed char*->int ][ !!! *5* !!! ][ 119 ][ 23 ][ 22 ]] |
| 679 | [[ signed char*->short ][ !!! *5* !!! ][ 116 ][ 23 ][ 22 ]] |
| 680 | [[ signed char*->long int ][ !!! *6* !!! ][ 116 ][ 23 ][ 22 ]] |
| 681 | [[ signed char*->long long ][ !!! *6* !!! ][ 115 ][ 23 ][ 22 ]] |
| 682 | [[ signed char*->unsigned int ][ !!! *5* !!! ][ 116 ][ 23 ][ 22 ]] |
| 683 | [[ signed char*->unsigned short ][ !!! *5* !!! ][ 114 ][ 22 ][ 22 ]] |
| 684 | [[ signed char*->unsigned long int ][ !!! *6* !!! ][ 92 ][ 9 ][ 8 ]] |
| 685 | [[ signed char*->unsigned long long ][ !!! *3* !!! ][ 60 ][ 9 ][ 10 ]] |
| 686 | [[ signed char*->float ][ 94 ][ 134 ][ 51 ][ !!! *28* !!! ]] |
| 687 | [[ signed char*->double ][ 47 ][ 80 ][ 31 ][ !!! *22* !!! ]] |
| 688 | [[ signed char*->long double ][ 90 ][ 115 ][ 64 ][ !!! *25* !!! ]] |
| 689 | [[ signed char*->array<char, 50> ][ !!! *<1* !!! ][ 97 ][ 22 ][ 17 ]] |
| 690 | [[ signed char*->string ][ !!! *11* !!! ][ 139 ][ 34 ][ --- ]] |
| 691 | [[ signed char*->container::string ][ !!! *<1* !!! ][ 118 ][ 26 ][ --- ]] |
| 692 | [[ iterator_range<char*>->char ][ !!! *<1* !!! ][ 106 ][ 15 ][ 10 ]] |
| 693 | [[ iterator_range<char*>->signed char ][ !!! *<1* !!! ][ 107 ][ 15 ][ 13 ]] |
| 694 | [[ iterator_range<char*>->unsigned char ][ !!! *<1* !!! ][ 107 ][ 15 ][ 12 ]] |
| 695 | [[ iterator_range<char*>->int ][ !!! *5* !!! ][ 117 ][ 25 ][ 22 ]] |
| 696 | [[ iterator_range<char*>->short ][ !!! *5* !!! ][ 116 ][ 25 ][ 22 ]] |
| 697 | [[ iterator_range<char*>->long int ][ !!! *6* !!! ][ 114 ][ 22 ][ 20 ]] |
| 698 | [[ iterator_range<char*>->long long ][ !!! *5* !!! ][ 106 ][ 23 ][ 22 ]] |
| 699 | [[ iterator_range<char*>->unsigned int ][ !!! *5* !!! ][ 104 ][ 21 ][ 20 ]] |
| 700 | [[ iterator_range<char*>->unsigned short ][ !!! *5* !!! ][ 105 ][ 22 ][ 20 ]] |
| 701 | [[ iterator_range<char*>->unsigned long int ][ !!! *5* !!! ][ 106 ][ 22 ][ 20 ]] |
| 702 | [[ iterator_range<char*>->unsigned long long ][ !!! *5* !!! ][ 105 ][ 23 ][ 20 ]] |
| 703 | [[ iterator_range<char*>->float ][ 89 ][ 140 ][ !!! *42* !!! ][ 43 ]] |
| 704 | [[ iterator_range<char*>->double ][ 88 ][ 127 ][ 43 ][ !!! *43* !!! ]] |
| 705 | [[ iterator_range<char*>->long double ][ 88 ][ 127 ][ 43 ][ !!! *43* !!! ]] |
| 706 | [[ iterator_range<char*>->array<char, 50> ][ !!! *<1* !!! ][ 104 ][ 22 ][ 15 ]] |
| 707 | [[ iterator_range<char*>->string ][ !!! *9* !!! ][ 122 ][ 32 ][ --- ]] |
| 708 | [[ iterator_range<char*>->container::string ][ !!! *<1* !!! ][ 105 ][ 24 ][ --- ]] |
| 709 | [[ array<char, 50>->char ][ !!! *<1* !!! ][ 68 ][ 4 ][ 4 ]] |
| 710 | [[ array<char, 50>->signed char ][ !!! *<1* !!! ][ 47 ][ 4 ][ 5 ]] |
| 711 | [[ array<char, 50>->unsigned char ][ !!! *<1* !!! ][ 48 ][ 4 ][ 5 ]] |
| 712 | [[ array<char, 50>->int ][ !!! *3* !!! ][ 53 ][ 9 ][ 8 ]] |
| 713 | [[ array<char, 50>->short ][ !!! *3* !!! ][ 54 ][ 9 ][ 8 ]] |
| 714 | [[ array<char, 50>->long int ][ !!! *3* !!! ][ 54 ][ 8 ][ 7 ]] |
| 715 | [[ array<char, 50>->long long ][ !!! *3* !!! ][ 53 ][ 8 ][ 8 ]] |
| 716 | [[ array<char, 50>->unsigned int ][ !!! *3* !!! ][ 52 ][ 7 ][ 8 ]] |
| 717 | [[ array<char, 50>->unsigned short ][ !!! *3* !!! ][ 53 ][ 8 ][ 7 ]] |
| 718 | [[ array<char, 50>->unsigned long int ][ !!! *3* !!! ][ 53 ][ 8 ][ 8 ]] |
| 719 | [[ array<char, 50>->unsigned long long ][ !!! *3* !!! ][ 53 ][ 9 ][ 8 ]] |
| 720 | [[ array<char, 50>->float ][ 43 ][ 72 ][ 29 ][ !!! *20* !!! ]] |
| 721 | [[ array<char, 50>->double ][ 42 ][ 72 ][ 28 ][ !!! *20* !!! ]] |
| 722 | [[ array<char, 50>->long double ][ 43 ][ 72 ][ 28 ][ !!! *20* !!! ]] |
| 723 | [[ array<char, 50>->array<char, 50> ][ !!! *<1* !!! ][ 53 ][ 8 ][ 6 ]] |
| 724 | [[ array<char, 50>->string ][ !!! *4* !!! ][ 62 ][ 13 ][ --- ]] |
| 725 | [[ array<char, 50>->container::string ][ !!! *1* !!! ][ 54 ][ 10 ][ --- ]] |
| 726 | [[ int->int ][ !!! *<1* !!! ][ 57 ][ 10 ][ --- ]] |
| 727 | [[ float->double ][ !!! *<1* !!! ][ 102 ][ 49 ][ --- ]] |
| 728 | [[ char->signed char ][ !!! *<1* !!! ][ 49 ][ 3 ][ --- ]] |
| 729 | ] |
| 730 | [endsect] |
| 731 | |
| 732 | |
| 733 | |
| 734 | [/ END of section, generated by performance measuring program ] |
| 735 | [endsect] |
| 736 | |