Maybe.map

If struct holds null, then nothingCase result is returned. If struct holds not null value, then $(justCase) result is returned. justCase is fed with unwrapped value.

  1. U map(U delegate() nothingCase, U delegate(T) justCase)
  2. U map(U delegate() nothingCase, U delegate(const T) justCase)
    struct Maybe(T)
    const
    U
    map
    (
    U
    )
    (
    U delegate
    ()
    nothingCase
    ,
    U delegate
    (
    const T
    )
    justCase
    )
    if (
    is(T == struct) ||
    isAssociativeArray!T
    ||
    isBasicType!T
    )

Meta