guard<R> method

R? guard<R>(
  1. R cb(
    1. T value
    )
)

Implementation

R? guard<R>(R Function(T value) cb) {
  if (this is T) return cb(this as T);
  return null;
}