andThen

Undocumented in source. Be warned that the author may not have intended to support it.
  1. auto andThen(Optional!T optional)
  2. auto andThen(Optional!T optional)
    andThen
    (
    alias pred
    T
    )
    (
    auto ref scope Optional!T optional
    )
    if (
    isSome!(typeof(pred(T.init))) ||
    isNone!(typeof(pred(T.init)))
    )
  3. auto andThen(Optional!T optional)

Examples

alias O = Optional!int;
assert(O.none.andThen!(i => some(i + 3)) == none);
assert(O.some(7).andThen!(i => none) == none);

Meta