aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pds.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pds.go b/src/pds.go
index 7f6e5d9..b853530 100644
--- a/src/pds.go
+++ b/src/pds.go
@@ -77,6 +77,15 @@ func (l *Vector[T]) clone() *Vector[T] {
return &other
}
+func NewVectorOf[T any](entries []T) *Vector[T] {
+ v := NewVectorBuilder[T]()
+ for _, x := range entries {
+ v.Append(x)
+ }
+
+ return v.Vector()
+}
+
// Len returns the number of elements in the vector.
func (l *Vector[T]) Len() int {
return l.size