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"
10namespace 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);
39 return this->error() ==
SUCCESS;
42#if SIMDJSON_EXCEPTIONS
51 return std::forward<implementation_simdjson_result_base<T>>(*this).value();
68simdjson_inline T& implementation_simdjson_result_base<T>::value() &
noexcept(
false) {
75 return std::forward<implementation_simdjson_result_base<T>>(*this).
take_value();
81 return std::forward<T>(this->first);
86 return std::forward<implementation_simdjson_result_base<T>>(*this).
take_value();
103 return std::forward<T>(this->first);
108 : 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 T & operator*() &noexcept(false)
Get the result value.
simdjson_warn_unused simdjson_inline bool has_value() const noexcept
Whether there is a value.
simdjson_inline const T & value_unsafe() const &noexcept
Get the result value.
simdjson_warn_unused 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 * operator->() noexcept(false)
Arrow operator to access members of the contained value.
simdjson_warn_unused simdjson_inline error_code error() const noexcept
The error.
simdjson_inline T && take_value() &&noexcept(false)
Take the result value (move it).
Exception thrown when an exception-supporting simdjson method is called.