News for hackers. Stuff that matters.
Re:Switching from C++ to Rust by cmrdporcupine on Monday March 13, 2023 @08:23PM (#35145389)
Sounds like Google/abseil's "StatusOr', but maybe a bit more freefrom?

https://abseil.io/docs/cpp/guides/status

Re:Switching from C++ to Rust by loeg on Monday March 13, 2023 @08:32PM (#35145500)
Yeah, we use a fixed-E alias of folly::Expected<> in our codebase which is similar to absl::StatusOr. Something like:

  namespace our_project {
    class Status { ... };
  
    template <class T>
    using Expected = folly::Expected<T, Status>;
  }
absl::StatusOr<T> looks a lot like our_project::Expected<T>.