• Dominik Charousset's avatar
    Re-implement result<...> as sum type · b5d446af
    Dominik Charousset authored
    The `result` class predates the sum type API in CAF and used a flag for
    selecting one of several members. Re-implementing the class with a
    `variant` instead is both cleaner and more idiomatic.
    
    Furthermore, the implementation for `result` now uses a base type that
    wraps state as well common constructors. The class `result` is merely a
    thin wrapper around the base with additional constructors. For example,
    results with a single template parameter allow conversion from
    `expected`. This fixes #989 by avoiding catch-all constructors and
    unreliable `enable_if` magic.
    b5d446af
expected.hpp 10.9 KB