Documentation
¶
Index ¶
- func Compare[T comparable](ptr1, ptr2 *T) bool
- func CompareF[T any](ptr1, ptr2 *T, compare func(t1, t2 *T) bool) bool
- func Def[R any, P *R](val P) R
- func Do[R any, P *R](ptr P, do func(v R) *R) *R
- func Or[R any, P *R](val P, other R) R
- func OrRef[R any, P *R](val P, other P) P
- func Ref[T any](t T) *T
- func Run[R any, P *R](ptr P, do func(v R))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare[T comparable](ptr1, ptr2 *T) bool
func CompareF ¶
CompareF compares two types using their pointers. Values passed to compare func never take nil/zero vales.
func Def ¶
func Def[R any, P *R](val P) R
Def behaves as Or(val, *new(R)), so it returns default type value if value is not present.
func Do ¶
func Do[R any, P *R](ptr P, do func(v R) *R) *R
Do safely executes function 'do' in case ptr is not nil or returns 'nil' otherwise.
Types ¶
This section is empty.