// Slice converts a Vector to a slice []T.
func (v Vector[T]) Slice() []T {
// We consider v.Data a pointer to 1st element of a slice []T
// of size v.Size and capacity v.Capacity
return unsafe.Slice(v.Data, v.Size)
}
The problem is, that in most Vector implementations T is supposed to be a pointer to the Go-wrapped type, so converting it to the C slice makes no sense (and causes issues).
this should either refer to v.Data.CData or make T a C type pointer (need to design this somehow)
The problem is, that in most Vector implementations
Tis supposed to be a pointer to the Go-wrapped type, so converting it to the C slice makes no sense (and causes issues).this should either refer to
v.Data.CDataor makeTa C type pointer (need to design this somehow)