diff --git a/index.html b/index.html index 7b3f700..ddbcd2e 100644 --- a/index.html +++ b/index.html @@ -89,7 +89,8 @@
result-cpp
-

Result-CPP is a C++ library that provides a Result<T, E> type, which can be used to return and propagate errors. It's inspired by Rust's std::Result type.

+

GitHub License Github Tests workflow Github Tests workflow

+

Result-CPP is a C++ library that provides a Result<T, E> type, which can be used to return and propagate errors. It's inspired by Rust's std::Result type.

Features

    @@ -105,9 +106,9 @@

    res::Result<int, std::string> divide(int a, int b) {
    if (b == 0) {
    -
    return res::Result<int, std::string>::Err("Division by zero");
    +
    return res::Err(std::string("Division by zero"));
    } else {
    - +
    return res::Ok(a / b);
    }
    }
    @@ -120,6 +121,8 @@

    std::cout << "Error: " << result.unwrap_err() << '\n';
    }
    }
    +
    Err object represents an unsuccessful outcome and can be converted to a Result.
    Definition: result.h:73
    +
    Ok object represents a successful outcome and can be converted to a Result.
    Definition: result.h:48
    Result is a type that represents either success or failure.
    Definition: result.h:25
    result-cpp is a C++ library that provides a Result<T, E> type, which can be used to return and propag...