▲ 13 ▼ a small implementation for std::expected for C++11 (github.com) submitted 1 year ago by nodeluna@programming.dev to c/cpp@programming.dev 8 comments fedilink hide all child comments
[–] bollybing@lemmynsfw.com 3 points 1 year ago (1 child) I dont get it? permalink fedilink source hideshow 1 child comment replies: [–] nodeluna@programming.dev [S] 1 point 1 year ago what don't u get it? why did I make this? or what is the point of this type? if you are unfamiliar with std::expected then check out https://en.cppreference.com/w/cpp/utility/expected.html it's basically a type that let you return either a "value" or an "error" and the caller of the function has to check which did the function return. it's a modern way of handling errors in C++ that was introduced in C++23 permalink fedilink source parent
[–] nodeluna@programming.dev [S] 1 point 1 year ago what don't u get it? why did I make this? or what is the point of this type? if you are unfamiliar with std::expected then check out https://en.cppreference.com/w/cpp/utility/expected.html it's basically a type that let you return either a "value" or an "error" and the caller of the function has to check which did the function return. it's a modern way of handling errors in C++ that was introduced in C++23 permalink fedilink source parent