Since the number and base are template parameters, each differing `to_string` use will get its own character buffer.
The integer/string conversion is done using a simple method I learned over the years, where the string is built in reverse using `n % base` to calculate the value of the lowest digit:
As you may have noticed, `buf` needs to be given a size for all this to work; in fact, the above code relies on the buffer having a size equal to the generated string (or else `buf[0]` would still be uninitialized). This is actually the case: a lambda is used within `buf`'s declaration to count how many characters long the string will ultimately be. This counting is done in a manner similar to conversion loop shown above:
```cpp
char buf[([] {
unsigned int len = N >= 0 ? 1 : 2; // Need one byte for '\0', two if there'll be a minus