|
bool | is_succ () const noexcept |
| 是否为succ?
|
|
bool | is_err () const noexcept |
| 是否为err?
|
|
const_reference_value_type | unsafe_get_succ_value () const noexcept |
| 取得succ的值
|
|
const_reference_error_type | unsafe_get_err_value () const noexcept |
| 取得err的值
|
|
reference_value_type | unsafe_get_succ_value_mut () noexcept |
| 取得succ的值(可变引用)
|
|
reference_error_type | unsafe_get_err_value_mut () noexcept |
| 取得err的值(可变引用)
|
|
result< E, T > | conjugate () const noexcept |
| 交换succ和err的情况以及值
|
|
template<typename T1 = T> |
details::enable_if_t< details::is_result< T1 >::value, result< typename T1::value_type, E > > | flatten () const noexcept |
| 扁平化
|
|
template<typename T1 = T> |
details::enable_if_t<!details::is_result< T1 >::value, result< T1, E > > | flatten () const noexcept |
| 扁平化 (T不是result<T, E>的情况)
|
|
template<typename F , typename R = details::function_return_type_t<F>> |
details::enable_if_t< details::holds_prototype< F, R, T >::value, result< R, E > > | map (F map_to) const |
| 在result是succ的时候执行map, 转换result
|
|
template<typename F , typename R = details::function_return_type_t<F>> |
details::enable_if_t< details::holds_prototype< F, R, E >::value, result< T, R > > | map_err (F map_to) const |
| 在result是err的时候执行map, 转换result
|
|
template<typename F , typename R1 = details::function_return_type_t<F>, typename R = details::enable_if_t< details::is_result<R1>::value, typename R1::value_type>> |
details::enable_if_t< details::holds_prototype< F, result< R, E >, T >::value, result< R, E > > | and_then (F then_do) const |
| 在self是succ的时候执行then do, 否则返回err
|
|
template<typename F , typename R1 = details::function_return_type_t<F>, typename R = details::enable_if_t< details::is_result<R1>::value, typename R1::error_type>> |
details::enable_if_t< details::holds_prototype< F, result< T, R >, E >::value, result< T, R > > | or_else (F else_do) const |
| 在self是err的时候执行else_do, 否则返回succ
|
|
const_reference_value_type | or_value (const_reference_value_type or_val) const noexcept |
| 如果为T则返回T, 不然返回or_val
|
|
template<typename F , typename R1 = details::function_return_type_t<F>, typename R = details:: enable_if_t<std::is_base_of<std::exception, R1>::value, R1>> |
details::enable_if_t< details::holds_prototype< F, R, E >::value, const_reference_value_type > | or_exception (F cont) const |
| 如果为T则返回T, 不然抛出异常
|
|
template<typename T, typename E>
class mtfmt::result< T, E >
结果类
- 模板参数
-