package nstd

// MakeSlice makes a slice with the specified length.
// Different from the built-in [make] function, the capacity
// of the result slice might be larger than the length.
func [ ~[],  any]( int)  {
	return append((nil), make(, )...)
}

// MakeSliceWithMinCap makes a slice with capacity not smaller than cap.
// The length of the result slice is zero.
//
// See: https://github.com/golang/go/issues/69872
func [ ~[],  any]( int)  {
	return append((nil), make(, )...)[:0]
}

// CloneSlice clones a slice.
// Different from [slices.Clone], the result of CloneSlice
// always has equal length and capacity.
func [ ~[],  any]( )  {
	var  = make(, len())
	copy(, )
	return 
}

// UnnamedSlice converts s to unnamed type.
func [ ~[],  any]( ) [] {
	return 
}

// SliceElemPointers returns an iterator which iterates element pointers of a slice.
func [ any]( []) func(func(*) bool) {
	return func( func(*) bool) {
		for  := range  {
			if !(&[]) {
				break
			}
		}
	}
}