• nodeluna@programming.devOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months 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