result
result copied to clipboard
My implementation of a C++ Result<T, E> type inspired by Rust
`namespace concept` is invalid in C++20-enabled compilers because `concept` is then a keyword.
See https://stackoverflow.com/questions/1238016/are-compound-statements-blocks-surrounded-by-parens-expressions-in-ansi-c for reasoning.
https://github.com/oktal/result/blob/fee9af7e0c775f0148810f9449fa8354b3eec569/result.h#L862-L873 Shouldn't a simple `return false;` in the end fix it?
Could you add an example for mapError function usage?
``` template class #if __cplusplus >= 201703L [[nodiscard]] #endif Result { }; ``` This is c++17 feature and will show warning if you will ignore the Result
Is it still possible to use andThen/bind ? "then" is not what i'm looking for (i think).
Required for non-copy constructible types.
Right now this library contains two versions of `Result`: one with normal `Ok` enum and another with `void` one. It may be a short-term convenience for callers (simple Ok() suffices...