Commit dab9471
committed
Parsing: use <charconv> from_chars on C++17
When building for C++17 or later, NumberUtils can use standard
<charconv> from_chars functions (except on Apple platforms, where
those are not implemented for floating point types as of Xcode 15).
This has advantage of not having to deal with errno nor locales.
Saves some thread local storage accesses and function calls (e.g. on
Windows errno is actually a function call).
With these changes, parsing Khronos PBR Neutral Iridas .cube file
(5.4MB) on Ryzen 5950X / VS2022 Release build: 142ms -> 123ms
There's a CMake setup change that adds "/Zc:__cplusplus" flag for MSVC;
for backwards compat reasons it does not report proper C++ version
detection defines otherwise.1 parent bcb7ce5 commit dab9471
2 files changed
+48
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
7 | 19 | | |
8 | 20 | | |
9 | 21 | | |
| |||
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
59 | | - | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
65 | 86 | | |
66 | 87 | | |
67 | 88 | | |
| |||
88 | 109 | | |
89 | 110 | | |
90 | 111 | | |
| 112 | + | |
91 | 113 | | |
92 | 114 | | |
93 | 115 | | |
94 | 116 | | |
95 | | - | |
96 | 117 | | |
97 | 118 | | |
98 | 119 | | |
99 | 120 | | |
100 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
101 | 132 | | |
102 | 133 | | |
103 | 134 | | |
| |||
132 | 163 | | |
133 | 164 | | |
134 | 165 | | |
| 166 | + | |
135 | 167 | | |
136 | 168 | | |
137 | 169 | | |
138 | 170 | | |
139 | | - | |
140 | 171 | | |
141 | 172 | | |
142 | 173 | | |
143 | 174 | | |
144 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
145 | 186 | | |
146 | 187 | | |
147 | 188 | | |
| |||
170 | 211 | | |
171 | 212 | | |
172 | 213 | | |
| 214 | + | |
173 | 215 | | |
174 | 216 | | |
175 | 217 | | |
| |||
0 commit comments