35 Commits (bd157e503a968ee3c470926cd540aa1d48ce6d02)
 

Author SHA1 Message Date
Clyne bd157e503a support c++14 2 years ago
Clyne 3234772a90
make digits inline; simplify digit_count 4 years ago
Clyne efe33d79d5
Match namespaces 4 years ago
Clyne 6710f1e699
Merge pull request #3 from SecMeant/digits_array
Removing magic constant from template param check
4 years ago
SecMeant 2717bb70ea Adding constexpr_to_string namespace
Namespace is used to prevent pollution of global namespace
by digits and digits_count symbols.
4 years ago
Clyne 95d70525ce
Merge branch 'master' into digits_array 4 years ago
Clyne 703b3fb5b0
Update README.md 4 years ago
Clyne c606eaa166
Update readme for f_to_string 4 years ago
Clyne 837c3cc7f7
removed unnecessary base support 4 years ago
Clyne 2006aa7e92 added f_to_string 4 years ago
Clyne 9503ccb716 added f_to_string 4 years ago
Clyne 5669272515
Changed other base instance to signed 4 years ago
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
SecMeant 83092fc5c6 Storing digits in variable, thus removing magic constant from template param check 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