11
12
// NewSortedSetManager returns a new SortedSetManager with the given comparison function and key function.
13
>
func NewSortedSetManager[S ~[]E, E, K any](cmp func(E, K) int, key func(E) K) SortedSetManager[S, E, K] {
sorted_set_manager.go
14
>
return SortedSetManager[S, E, K]{cmp, key}
15
>
}
16
17
// Add adds a new element to the set. If the element is already in the set, it returns the set unchanged and false.
19
>
i, found := m.find(set, m.key(e))
20
>
if found {
22
>
}
24
}
25