ΒΆtemplate <class T>
inline constexpr auto ok(T&& t) noexcept
template <class T>
inline constexpr auto ok(T&& t) noexcept
Description
Used to construct a [`Result <T , E>`]($sus::result::Result) with an `Ok(t)` value. Calling `ok()` produces a hint to make a Result <T , E> but does not actually construct [`Result <T , E>`]($sus::result::Result). This is to deduce the actual types `T` and `E` when it is constructed, avoid specifying them both here, and support conversions. [`Result <void , E>`]($sus::result::Result) can also be constructed from calling `ok()` without an argument.
Declared at: sus/result/result.h:956
Templates
- T
Parameters
- T&& t