32 Commits

Author SHA1 Message Date
6710f1e699
Merge pull request #3 from SecMeant/digits_array
Removing magic constant from template param check
2020-06-29 15:17:38 -04:00
SecMeant
2717bb70ea Adding constexpr_to_string namespace
Namespace is used to prevent pollution of global namespace
by digits and digits_count symbols.
2020-06-29 19:31:21 +02:00
95d70525ce
Merge branch 'master' into digits_array 2020-06-29 13:21:04 -04:00
703b3fb5b0
Update README.md 2020-06-28 12:33:42 -04:00
c606eaa166
Update readme for f_to_string 2020-06-28 09:27:46 -04:00
837c3cc7f7
removed unnecessary base support 2020-06-28 09:22:44 -04:00
2006aa7e92 added f_to_string 2020-06-28 09:21:03 -04:00
9503ccb716 added f_to_string 2020-06-28 09:20:12 -04:00
5669272515
Changed other base instance to signed 2020-06-27 19:13:18 -04:00
d680c02d03
Merge pull request #1 from EnilPajic/patch-1-negative-minimum-value
Fixed potential bug with -MINIMUM_VALUE
2020-06-27 19:09:25 -04:00
6e7939000f
Change base from unsigned to signed 2020-06-27 19:08:48 -04:00
a7dd0243fe
Merge branch 'master' into patch-1-negative-minimum-value 2020-06-27 19:02:24 -04:00
6ae484c801 add const and references to container operations 2020-06-27 18:37:33 -04:00
e395be3782 Use end() in constructor 2020-06-27 18:31:53 -04:00
eeb04bad15
Merge pull request #4 from Neargye/master
container-like
2020-06-27 18:14:43 -04:00
neargye
9aa286ebc0 container-like 2020-06-27 21:38:28 +05:00
SecMeant
83092fc5c6 Storing digits in variable, thus removing magic constant from template param check 2020-06-27 01:22:24 +02:00
8b2e3c7bc5
Update "how it works" section 2020-06-26 18:56:13 -04:00
f26a6dc4d5
Add note on custom character types 2020-06-26 18:50:47 -04:00
84401c7473
Add support for range-based for loops 2020-06-26 18:11:57 -04:00
8dfd9e49ad
Add support for different character widths 2020-06-26 18:05:11 -04:00
1d8ef0361c
Forgot to support to_string<0> 2020-06-26 17:47:48 -04:00
4cffc3ffbc
Remove resolved issue with GCC/C++17 2020-06-26 16:43:20 -04:00
37b7cd1715
Initialize buf for C++17 GCC; make to_string constexpr
https://www.reddit.com/r/cpp/comments/hgcaih/compiletime_integertostring_conversion_c17/fw3d2fm/
2020-06-26 16:41:17 -04:00
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.
2020-06-26 21:25:39 +02:00
2be778931d
Added explanation of code 2020-06-26 13:42:41 -04:00
5510e86a96
Described new changes 2020-06-26 13:14:54 -04:00
796eb3e7ee
Remove redundant length calculation; expand base support to 36 2020-06-26 13:12:14 -04:00
aa85b760a8
Added compiler explorer link 2020-06-26 11:16:59 -04:00
0f38f29202
Update README.md 2020-06-26 11:13:25 -04:00
a436ba6867
Create to_string.hpp 2020-06-26 11:02:37 -04:00
2cd6a7d877
Initial commit 2020-06-26 10:47:36 -04:00