From: Wolfgang Bangerth Date: Tue, 21 Jan 2020 18:09:45 +0000 (-0700) Subject: Update the documentation of int_to_string() and to_string(). X-Git-Tag: v9.2.0-rc1~608^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fabc3ac77193a5cd31c9abf3d27166c95770e5e1;p=dealii.git Update the documentation of int_to_string() and to_string(). --- diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index bb75635629..ee8f401a70 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -177,10 +177,15 @@ namespace Utilities * * If the second parameter is left at its default value, the number is not * padded with leading zeros. The result is then the same as if the standard - * C function itoa() had been called. + * C++ `std::to_string` (or the older C function `itoa()`) had been called. * - * When calling this function signed integers are implicitly converted to - * unsigned integers and long integers might experience an overflow. + * This function takes an `unsigned int` as argument. As a consequence, + * if you call it with a `signed int` (which is of course the same + * type as `int`), the argument is implicitly converted to + * unsigned integers and negative numbers may not be printed as you had + * hoped. Similarly, if you call the function with a `long int`, the + * printed result might show the effects of an overflow upon conversion + * to `unsigned int`. * * @note The use of this function is discouraged and users should use * Utilities::to_string() instead. In its current @@ -198,8 +203,8 @@ namespace Utilities * decimal points and digits of @p value. * * If the second parameter is left at its default value, the number is not - * padded with leading zeros. The result is then the same as if the boost - * function lexical_cast@() had been called. + * padded with leading zeros. The result is then the same as if the C++ + * function `std::to_string()` had been called. */ template std::string