result VS result

Compare result vs result and see what are their differences.

result

My implementation of a C++ Result<T, E> type inspired by Rust (by oktal)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
result result
5 2
265 314
- -
0.0 0.0
over 1 year ago 5 months ago
C++ C++
MIT License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

result

Posts with mentions or reviews of result. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-11.

result

Posts with mentions or reviews of result. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-11.
  • Real-world examples of std::expected in codebases?
    7 projects | /r/cpp | 11 Dec 2022
    Example of other people trying to do it in a generic way, as a separate library (instead of in the utility part of some bigger codebase): - https://github.com/bitwizeshift/result - https://github.com/oktal/result - https://github.com/basicpp17/result17 - https://github.com/p-ranav/result
  • Is Haskell a Good Choice for Software Security?
    2 projects | news.ycombinator.com | 17 Dec 2021
    I'd say, take a look at error handling. In Haskell you can accomplish a lot by just using `Maybe` and `Either` along with the functions related to them, provided by the standard library. Haskell's pattern matching feature makes it even more straight forward to handle these types.

    A lot of this translates to Rust, as Haskell influenced the language design of Rust. In Rust you have `std::option::Option` and `std::result::Result` which relate closely to `Maybe` and `Either`, respectively. Also pattern matching is available in Rust.

    When you then look at other (imperative) languages like Go, C, and C++, error handling becomes a bit more cumbersome IMHO. I am not talking about explicit or implicit error handling. It's more about urging the programming to check for and handle errors, and also giving them the necessary tools to do that efficiently.

    In Go, you have lots of `if err != nil { return err }`, which is cumbersome to write (luckily we have snippets) and _clutters_ the code. Yes, it is explicit and easy to read, but I don't think error handling should make up 4/5 of the lines of your algorithm.

    The same applies to C, more or less, as functions typically tell you about success or failure via their return value. Like `err` in Go.

    In C++ we have `std::optional` which is handy, but C++ lacks a lot of functional features and convenient syntax to take full advantage of it. No straight forward pattern matching here. There is `std::variant` to create sum types, but I've only seen that in use occasionally. There is also `std::expected` on the horizon, which is similar to `Either` / `std::result::Result`, but adoption will take ages.

    C++, being a complicated language, makes it very difficult to just come up with your own wrapper classes that _just work_. See https://github.com/oktal/result/blob/master/result.h for example.

What are some alternatives?

When comparing result and result you can also consider the following projects:

exceptxx - C++ exception handling library

powerloader

robin-hood-hashing - Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20

BackportCpp - Library of backported modern C++ types to work with C++11

entt - Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

expected - P0323 & P2505 std::expected simple implementation

RSL - ROS Support Library

result17 - A rust like Result type for modern C++