func Filter[T any](a *[]T, keep func(t T) bool) {
	n := 0
	for _, x := range *a {
		if keep(x) {
			(*a)[n] = x
			n++
		}
	}

	for i := n; i < len(*a); i++ {
		var zero T
		(*a)[i] = zero
	}

	*a = (*a)[:n]
}
// Filter removes any elements from a for which keep returns false.
Filter removes any elements from a for which keep returns false.
// Filter removes any elements from a for which keep returns false .
func Filter[T any](a *[]T, keep func(t T) bool) {
	n := 0
	for _, x := range *a {
		if keep(x) {
			(*a)[n] = x
			n++
		}
	}
	for i := n; i < len(*a); i++ {
		var zero T
		(*a)[i] = zero
	}
	*a = (*a)[:n]
}
func Filter [ T any ] ( a * [ ] T , keep func ( t T ) bool ) { n := 0 for _ , x := range * a { if keep ( x ) { ( * a ) [ n ] = x n ++ } } for i := n ; i < len ( * a ) ; i ++ { var zero T ( * a ) [ i ] = zero } * a = ( * a ) [ : n ] }
Filter removes any elements from a for which keep returns false.
Filter removes any elements from a for which keep returns false .