&int — illegal new(int) — legal
TBH still seems weird to reserve a keyword for that
yes there is. It's useful when you need to create a new zero value on the heap
func MakeZero[T any]() *T { return new(T) } I suppose that should work
https://stackoverflow.com/a/55536729
Обсуждают сегодня