Concept Subspace :: sus :: ops :: TryErrorConvertibleTo

template <class From, class To>
concept TryErrorConvertibleTo
requires
sus::ops::Try<From>
sus::ops::Try<To>
requires(From&& f) {
      // preserve_error() constructs a Try type from another related type while
      // passing the error state along.
      {
        TryImpl<To>::template preserve_error(::sus::move(f))
      } -> std::same_as<To>;
    }

Can be used to further constrain the relationship between two Try types such that an error in one can be used to construct the other type.

This allows Try<A, E> to be returned from a function working with Try<B, E> in the case of an error, as sus::ops::try_preserve_error<A>() can be used to construct the error return type.