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
20082026
-
…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.
comment by w4rh4wk5 · 2021-12-17 · in Is Haskell a good choice for software security? -
…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…
comment by kllrnohj · 2018-12-13 · in Why should I have written ZeroMQ in C, not C++ (2012) -
…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…
comment by gpm · 2017-04-28 · in A bug in GCC that may cause memory leaks in valid C++ programs