|
|
@ -32,9 +32,9 @@ class to_string_t {
|
|
|
|
* Constructs the object, filling `buf` with the string representation of N.
|
|
|
|
* Constructs the object, filling `buf` with the string representation of N.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
constexpr to_string_t() noexcept {
|
|
|
|
constexpr to_string_t() noexcept {
|
|
|
|
|
|
|
|
auto ptr = end();
|
|
|
|
|
|
|
|
*--ptr = '\0';
|
|
|
|
if (N != 0) {
|
|
|
|
if (N != 0) {
|
|
|
|
auto ptr = buf + sizeof(buf) / sizeof(buf[0]);
|
|
|
|
|
|
|
|
*--ptr = '\0';
|
|
|
|
|
|
|
|
for (auto n = N < 0 ? -N : N; n; n /= base)
|
|
|
|
for (auto n = N < 0 ? -N : N; n; n /= base)
|
|
|
|
*--ptr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[n % base];
|
|
|
|
*--ptr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[n % base];
|
|
|
|
if (N < 0)
|
|
|
|
if (N < 0)
|
|
|
|