and<U> abstract method

  1. @useResult
Option<U> and<U>(
  1. Option<U> other
)

Returns other if this is a Some, or None otherwise.

Examples

// prints "Some(3)"
print(const Some(2).and(const Some(3)));

// prints "None"
print(const None<int>().and(const Some(3)));

Implementation

@useResult
Option<U> and<U>(Option<U> other);