andThen

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

Examples

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

Meta