Hacker GitHub

← All repos

oktal/result

View on GitHub ↗ ★ 360 C++

My implementation of a C++ Result<T, E> type inspired by Rust

3 mentions on Hacker News by 3 people: 0 stories, 3 comments · first 2017-04-28 · latest 2021-12-17

Mentions per year 3 mentions · busiest year 2017 (1)
20082026
  1. …makes it very difficult to just come up with your own wrapper classes that _just work_. See https://github.com/oktal/result/blob/master/result.h for example.
  2. …success, but that's an assumption not a contract of the type. By comparison some something like https://github.com/oktal/result will tell you if it's a success or error without any magic error codes that actually mean success. You could do…
  3. …general "rust enum", this repository does it (while only allocating space for the larger, I think) https://github.com/oktal/result/ And I don't think there's any reason you couldn't implement an equivalent of std::variant for previous…