You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The simdjson library builds on compilers supporting the C++11 standard.
201
-
We represent parsed strings in simdjson using the `std::string_view` class.
202
-
This class has become standard as part of C++17 but it is not always available
203
-
on compilers which only supports C++11. When we detect that it is unavailable,
200
+
The simdjson library builds on compilers supporting the [C++11 standard](https://en.wikipedia.org/wiki/C%2B%2B11). It is also a strict requirement: we have no plan to support older C++ compilers.
201
+
202
+
We represent parsed strings in simdjson using the `std::string_view` class. It avoids
203
+
the need to copy the data, as would be necessary with the `std::string` class. It also
204
+
avoids the pitfalls of null-terminated C strings.
205
+
206
+
The `std::string_view` class has become standard as part of C++17 but it is not always available
207
+
on compilers which only supports C++11. When we detect that `string_view` is natively
208
+
available, we define the macro `SIMDJSON_HAS_STRING_VIEW`.
209
+
210
+
When we detect that it is unavailable,
204
211
we use [string-view-lite](https://github.com/martinmoene/string-view-lite) as a
205
212
substitute. In such cases, we use the type alias `using string_view = nonstd::string_view;` to
206
-
offer the same API, irrespective of the compiler and standard library.
213
+
offer the same API, irrespective of the compiler and standard library. The macro
214
+
`SIMDJSON_HAS_STRING_VIEW` will be *undefined* to indicate that we emulate `string_view`.
0 commit comments