22 Commits (d680c02d03e7a652f0b7e8daf4d52b7ae230c513)
 

Author SHA1 Message Date
Clyne d680c02d03
Merge pull request #1 from EnilPajic/patch-1-negative-minimum-value
Fixed potential bug with -MINIMUM_VALUE
4 years ago
Clyne 6e7939000f
Change base from unsigned to signed 4 years ago
Clyne a7dd0243fe
Merge branch 'master' into patch-1-negative-minimum-value 4 years ago
Clyne 6ae484c801 add const and references to container operations 4 years ago
Clyne e395be3782 Use end() in constructor 4 years ago
Clyne eeb04bad15
Merge pull request #4 from Neargye/master
container-like
4 years ago
neargye 9aa286ebc0 container-like 4 years ago
Clyne 8b2e3c7bc5
Update "how it works" section 4 years ago
Clyne f26a6dc4d5
Add note on custom character types 4 years ago
Clyne 84401c7473
Add support for range-based for loops 4 years ago
Clyne 8dfd9e49ad
Add support for different character widths 4 years ago
Clyne 1d8ef0361c
Forgot to support to_string<0> 4 years ago
Clyne 4cffc3ffbc
Remove resolved issue with GCC/C++17 4 years ago
Clyne 37b7cd1715
Initialize buf for C++17 GCC; make to_string constexpr
https://www.reddit.com/r/cpp/comments/hgcaih/compiletime_integertostring_conversion_c17/fw3d2fm/
4 years ago
EnilPajic 5baf5d3dae
Fixed potential bug with -MINIMUM_VALUE
Original code had something like `N < 0 ? -N : N` which could fail if `N` has minimum value of appropriate type. For example, in original code this could fail:
```cpp
const long long int LL_MIN = std::numeric_limits<long long int>::min(); //probably: -9223372036854775808
static const char *number = to_string<LL_MIN, 10>;
```

Also note that this code relies on "modulo on negative first operands" which was implementation defined in C++03 and before, but with C++11 and later it is defined by standard (see `ISO14882:2011(e)`), and this code anyway targets C++17 so we're safe here.
4 years ago
Clyne 2be778931d
Added explanation of code 4 years ago
Clyne 5510e86a96
Described new changes 4 years ago
Clyne 796eb3e7ee
Remove redundant length calculation; expand base support to 36 4 years ago
Clyne aa85b760a8
Added compiler explorer link 4 years ago
Clyne 0f38f29202
Update README.md 4 years ago
Clyne a436ba6867
Create to_string.hpp 4 years ago
Clyne 2cd6a7d877
Initial commit 4 years ago