1#ifndef SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H
3#ifndef SIMDJSON_CONDITIONAL_INCLUDE
4#define SIMDJSON_GENERIC_IMPLEMENTATION_SIMDJSON_RESULT_BASE_H
5#include "simdjson/generic/base.h"
9namespace SIMDJSON_IMPLEMENTATION {
70 simdjson_warn_unused simdjson_inline
error_code get(T &value) && noexcept;
80 simdjson_warn_unused simdjson_inline
bool has_value() const noexcept;
82#if SIMDJSON_EXCEPTIONS
89 simdjson_inline T&
operator*() &
noexcept(
false);
90 simdjson_inline T&&
operator*() &&
noexcept(
false);
96 simdjson_inline T*
operator->() noexcept(false);
97 simdjson_inline const T* operator->() const noexcept(false);
99 simdjson_inline T& value() & noexcept(false);
106 simdjson_inline T&& value() && noexcept(false);
113 simdjson_inline T&&
take_value() && noexcept(false);
120 simdjson_inline operator T&&() && noexcept(false);
129 simdjson_inline
const T&
value_unsafe() const& noexcept;
The top level simdjson namespace, containing everything the library provides.
error_code
All possible errors returned by simdjson.
@ UNINITIALIZED
unknown error, or uninitialized document
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.
error_code second
Users should never directly access 'first'.
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.
T first
users should never directly access first and second.
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).