#Can someone tell me what the "~" does in generics/type-constraints?

3 messages · Page 1 of 1 (latest)

warm flax
#
type Ordered interface {
    ~int | ~int8 | ~int16 | ~int32 | ~int64 |
        ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
        ~float32 | ~float64 |
        ~string
}
``` this code works just fine without the tildas. I just don't understand.
north lava
#

it's means that match derived types

#
type derived int

is also part of Ordered by of the ~ in front of int