From fabc3ac77193a5cd31c9abf3d27166c95770e5e1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 21 Jan 2020 11:09:45 -0700 Subject: [PATCH] Update the documentation of int_to_string() and to_string(). --- include/deal.II/base/utilities.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 -- 2.39.5