![]() |
simdjson 4.2.2
Ridiculously Fast JSON
|
The result of a simdjson operation that could fail. More...
#include <error.h>
Inherits simdjson::internal::simdjson_result_base< T >.
Public Types | |
| using | value_type = T |
| using | error_type = error_code |
Public Member Functions | |
| simdjson_inline void | tie (T &value, error_code &error) &&noexcept |
| Move the value and the error to the provided variables. | |
| simdjson_warn_unused simdjson_inline error_code | get (T &value) &&noexcept |
| Move the value to the provided variable. | |
| template<typename U = T> | |
| simdjson_warn_unused simdjson_inline error_code | get (std::string &value) &&noexcept |
| Copy the value to a provided std::string, only enabled for std::string_view. | |
| simdjson_inline error_code | error () const noexcept |
| The error. | |
| simdjson_inline T & | value () &noexcept(false) |
| Get the result value. | |
| simdjson_inline T && | value () &&noexcept(false) |
| Take the result value (move it). | |
| simdjson_inline T && | take_value () &&noexcept(false) |
| Take the result value (move it). | |
| simdjson_inline | operator T&& () &&noexcept(false) |
| Cast to the value (will throw on error). | |
| simdjson_inline const T & | value_unsafe () const &noexcept |
| Get the result value. | |
| simdjson_inline T && | value_unsafe () &&noexcept |
| Take the result value (move it). | |
The result of a simdjson operation that could fail.
Gives the option of reading error codes, or throwing an exception by casting to the desired result.
| using simdjson::simdjson_result< T >::error_type = error_code |
| using simdjson::simdjson_result< T >::value_type = T |
|
noexcept |
The error.
Definition at line 168 of file error-inl.h.
|
inlinenoexcept |
|
noexcept |
Move the value to the provided variable.
| value | The variable to assign the value to. May not be set if there is an error. |
Definition at line 163 of file error-inl.h.
| simdjson_inline simdjson::simdjson_result< T >::operator T&& | ( | ) | && |
Cast to the value (will throw on error).
| simdjson_error | if there was an error. |
Definition at line 190 of file error-inl.h.
| simdjson_inline T && simdjson::simdjson_result< T >::take_value | ( | ) | && |
Take the result value (move it).
| simdjson_error | if there was an error. |
Definition at line 185 of file error-inl.h.
|
noexcept |
Move the value and the error to the provided variables.
simdjson_result<T> inline implementation
| value | The variable to assign the value to. May not be set if there is an error. |
| error | The variable to assign the error to. Set to SUCCESS if there is no error. |
Definition at line 157 of file error-inl.h.
| simdjson_inline T && simdjson::simdjson_result< T >::value | ( | ) | && |
Take the result value (move it).
| simdjson_error | if there was an error. |
Definition at line 180 of file error-inl.h.
| simdjson_inline T & simdjson::simdjson_result< T >::value | ( | ) | & |
Get the result value.
| simdjson_error | if there was an error. |
Definition at line 175 of file error-inl.h.
|
noexcept |
Take the result value (move it).
This function is safe if and only the error() method returns a value that evaluates to false.
Definition at line 202 of file error-inl.h.
|
noexcept |
Get the result value.
This function is safe if and only the error() method returns a value that evaluates to false.
Definition at line 197 of file error-inl.h.