tl-expected

C++11/14/17 std::expected implementation with functional extensions

brewmacoslinux
Try with needOr install directly
Source

About

C++11/14/17 std::expected with functional-style extensions

Commands

tl-expected

Examples

Include the header in a C++ project to use expected<T, E> type$ #include <tl/expected.hpp>
Create an expected value that either holds a success or error$ tl::expected<int, std::string> result = tl::expected<int, std::string>(42);
Use functional-style map operation on expected values$ auto transformed = result.map([](int x) { return x * 2; });