1 #ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H
3 #ifndef SIMDJSON_CONDITIONAL_INCLUDE
4 #define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_INL_H
5 #include "simdjson/generic/base.h"
6 #include "simdjson/generic/implementation_simdjson_result_base.h"
10 namespace SIMDJSON_IMPLEMENTATION {
20 value = std::forward<implementation_simdjson_result_base<T>>(*this).first;
27 std::forward<implementation_simdjson_result_base<T>>(*this).tie(value, error);
36 #if SIMDJSON_EXCEPTIONS
46 return std::forward<implementation_simdjson_result_base<T>>(*this).take_value();
52 return std::forward<T>(this->first);
57 return std::forward<implementation_simdjson_result_base<T>>(*this).
take_value();
74 return std::forward<T>(this->first);
79 : first{std::forward<T>(value)}, second{error} {}
The top level simdjson namespace, containing everything the library provides.
error_code
All possible errors returned by simdjson.
The result of a simdjson operation that could fail.
simdjson_inline implementation_simdjson_result_base() noexcept=default
Create a new empty result with error = UNINITIALIZED.
simdjson_inline error_code error() const noexcept
The error.
simdjson_inline T & value() &noexcept(false)
Get the result value.
simdjson_inline const T & value_unsafe() const &noexcept
Get the result value.
simdjson_inline error_code get(T &value) &&noexcept
Move the value to the provided variable.
simdjson_inline void tie(T &value, error_code &error) &&noexcept
Move the value and the error to the provided variables.
simdjson_inline T && take_value() &&noexcept(false)
Take the result value (move it).
Exception thrown when an exception-supporting simdjson method is called.