23 Result(T&& value)
noexcept(std::is_nothrow_move_constructible_v<T>)
24 :
mValue (std::forward<T>(value))
28 Result (
const Error& error)
noexcept(std::is_nothrow_copy_constructible_v<Error>)
33 Result (
Error&& error)
noexcept(std::is_nothrow_move_constructible_v<Error>)
34 :
mValue (std::move(error))
40 return std::holds_alternative<T>(
mValue);
46 std::get_if<Error>(&
mValue)->Raise();
48 return *std::get_if<T>(&
mValue);
53 return const_cast<Result*
>(
this)->
operator*();
69 std::get_if<Error>(&
mValue)->Raise();
71 return std::move(*std::get_if<T>(&
mValue));
74 explicit operator bool () const noexcept
84 return *std::get_if<Error>(&
mValue);
A class representing an error in SQLite.
A class representing a result of an operation.
bool HasValue() const noexcept
const T & operator*() const &
Error GetError() const noexcept
Result(Error &&error) noexcept(std::is_nothrow_move_constructible_v< Error >)
Result(T &&value) noexcept(std::is_nothrow_move_constructible_v< T >)
std::variant< Error, T > mValue
Result(const Error &error) noexcept(std::is_nothrow_copy_constructible_v< Error >)