Skip to content

Commit

Permalink
feat: pointer: add Clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Feb 2, 2025
1 parent 43e7fb4 commit c8ab4be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pointer/simple_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ func PointerSlice[S ~[]E, E any](s S) []*E {
}
return out
}

func Clone[E any](e *E) *E {
return Pointer(Dereference(e))
}

0 comments on commit c8ab4be

Please sign in to comment.