Concept Subspace :: sus :: construct :: TryFrom

template <class ToType, class FromType>
concept TryFrom
requires
requires(FromType&& from) {
  {
    ToType::try_from(::sus::forward<FromType>(from))
  } -> ::sus::result::__private::IsResultWithOkType<ToType>;
}

A concept that indicates ToType can be (sometimes) constructed from a FromType, via ToType::try_from(FromType).

Unlike sus::construct::From, using the try_from() method gives the opportunity to catch failures since the return type is a sus::Result.