2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2022-05-01 23:15:20 +00:00
|
|
|
|
|
|
|
// Code generated by tailscale.com/cmd/cloner; DO NOT EDIT.
|
|
|
|
|
|
|
|
package tests
|
|
|
|
|
|
|
|
import (
|
2023-08-20 17:16:06 +00:00
|
|
|
"maps"
|
2022-07-25 03:08:42 +00:00
|
|
|
"net/netip"
|
2023-08-20 17:16:06 +00:00
|
|
|
|
2024-07-08 15:11:00 +00:00
|
|
|
"golang.org/x/exp/constraints"
|
2023-08-20 17:16:06 +00:00
|
|
|
"tailscale.com/types/ptr"
|
2024-07-08 15:11:00 +00:00
|
|
|
"tailscale.com/types/views"
|
2022-05-01 23:15:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Clone makes a deep copy of StructWithPtrs.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *StructWithPtrs) Clone() *StructWithPtrs {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(StructWithPtrs)
|
|
|
|
*dst = *src
|
|
|
|
if dst.Value != nil {
|
2023-08-20 17:16:06 +00:00
|
|
|
dst.Value = ptr.To(*src.Value)
|
2022-05-01 23:15:20 +00:00
|
|
|
}
|
|
|
|
if dst.Int != nil {
|
2023-08-20 17:16:06 +00:00
|
|
|
dst.Int = ptr.To(*src.Int)
|
2022-05-01 23:15:20 +00:00
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _StructWithPtrsCloneNeedsRegeneration = StructWithPtrs(struct {
|
|
|
|
Value *StructWithoutPtrs
|
|
|
|
Int *int
|
|
|
|
NoCloneValue *StructWithoutPtrs
|
|
|
|
}{})
|
|
|
|
|
|
|
|
// Clone makes a deep copy of StructWithoutPtrs.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *StructWithoutPtrs) Clone() *StructWithoutPtrs {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(StructWithoutPtrs)
|
|
|
|
*dst = *src
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _StructWithoutPtrsCloneNeedsRegeneration = StructWithoutPtrs(struct {
|
|
|
|
Int int
|
2022-07-25 03:08:42 +00:00
|
|
|
Pfx netip.Prefix
|
2022-05-01 23:15:20 +00:00
|
|
|
}{})
|
|
|
|
|
|
|
|
// Clone makes a deep copy of Map.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *Map) Clone() *Map {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(Map)
|
|
|
|
*dst = *src
|
2023-08-20 17:16:06 +00:00
|
|
|
dst.Int = maps.Clone(src.Int)
|
2022-05-09 16:30:39 +00:00
|
|
|
if dst.SliceInt != nil {
|
|
|
|
dst.SliceInt = map[string][]int{}
|
|
|
|
for k := range src.SliceInt {
|
|
|
|
dst.SliceInt[k] = append([]int{}, src.SliceInt[k]...)
|
|
|
|
}
|
|
|
|
}
|
2022-07-13 06:45:37 +00:00
|
|
|
if dst.StructPtrWithPtr != nil {
|
|
|
|
dst.StructPtrWithPtr = map[string]*StructWithPtrs{}
|
|
|
|
for k, v := range src.StructPtrWithPtr {
|
2024-07-08 15:11:00 +00:00
|
|
|
if v == nil {
|
|
|
|
dst.StructPtrWithPtr[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.StructPtrWithPtr[k] = v.Clone()
|
|
|
|
}
|
2022-07-13 06:45:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.StructPtrWithoutPtr != nil {
|
|
|
|
dst.StructPtrWithoutPtr = map[string]*StructWithoutPtrs{}
|
|
|
|
for k, v := range src.StructPtrWithoutPtr {
|
2024-07-08 15:11:00 +00:00
|
|
|
if v == nil {
|
|
|
|
dst.StructPtrWithoutPtr[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.StructPtrWithoutPtr[k] = ptr.To(*v)
|
|
|
|
}
|
2022-05-09 16:30:39 +00:00
|
|
|
}
|
|
|
|
}
|
2023-08-20 17:16:06 +00:00
|
|
|
dst.StructWithoutPtr = maps.Clone(src.StructWithoutPtr)
|
2022-05-09 16:30:39 +00:00
|
|
|
if dst.SlicesWithPtrs != nil {
|
|
|
|
dst.SlicesWithPtrs = map[string][]*StructWithPtrs{}
|
|
|
|
for k := range src.SlicesWithPtrs {
|
|
|
|
dst.SlicesWithPtrs[k] = append([]*StructWithPtrs{}, src.SlicesWithPtrs[k]...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.SlicesWithoutPtrs != nil {
|
|
|
|
dst.SlicesWithoutPtrs = map[string][]*StructWithoutPtrs{}
|
|
|
|
for k := range src.SlicesWithoutPtrs {
|
|
|
|
dst.SlicesWithoutPtrs[k] = append([]*StructWithoutPtrs{}, src.SlicesWithoutPtrs[k]...)
|
|
|
|
}
|
|
|
|
}
|
2023-08-20 17:16:06 +00:00
|
|
|
dst.StructWithoutPtrKey = maps.Clone(src.StructWithoutPtrKey)
|
2024-07-08 15:11:00 +00:00
|
|
|
if dst.StructWithPtr != nil {
|
|
|
|
dst.StructWithPtr = map[string]StructWithPtrs{}
|
|
|
|
for k, v := range src.StructWithPtr {
|
|
|
|
dst.StructWithPtr[k] = *(v.Clone())
|
|
|
|
}
|
|
|
|
}
|
2022-05-09 16:30:39 +00:00
|
|
|
if dst.SliceIntPtr != nil {
|
|
|
|
dst.SliceIntPtr = map[string][]*int{}
|
|
|
|
for k := range src.SliceIntPtr {
|
|
|
|
dst.SliceIntPtr[k] = append([]*int{}, src.SliceIntPtr[k]...)
|
|
|
|
}
|
|
|
|
}
|
2023-08-20 17:16:06 +00:00
|
|
|
dst.PointerKey = maps.Clone(src.PointerKey)
|
|
|
|
dst.StructWithPtrKey = maps.Clone(src.StructWithPtrKey)
|
2022-05-01 23:15:20 +00:00
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _MapCloneNeedsRegeneration = Map(struct {
|
2022-05-09 16:30:39 +00:00
|
|
|
Int map[string]int
|
|
|
|
SliceInt map[string][]int
|
2022-07-13 06:45:37 +00:00
|
|
|
StructPtrWithPtr map[string]*StructWithPtrs
|
|
|
|
StructPtrWithoutPtr map[string]*StructWithoutPtrs
|
|
|
|
StructWithoutPtr map[string]StructWithoutPtrs
|
2022-05-09 16:30:39 +00:00
|
|
|
SlicesWithPtrs map[string][]*StructWithPtrs
|
|
|
|
SlicesWithoutPtrs map[string][]*StructWithoutPtrs
|
|
|
|
StructWithoutPtrKey map[StructWithoutPtrs]int
|
2024-07-08 15:11:00 +00:00
|
|
|
StructWithPtr map[string]StructWithPtrs
|
2022-05-09 16:30:39 +00:00
|
|
|
SliceIntPtr map[string][]*int
|
|
|
|
PointerKey map[*string]int
|
|
|
|
StructWithPtrKey map[StructWithPtrs]int
|
2022-05-01 23:15:20 +00:00
|
|
|
}{})
|
|
|
|
|
|
|
|
// Clone makes a deep copy of StructWithSlices.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *StructWithSlices) Clone() *StructWithSlices {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(StructWithSlices)
|
|
|
|
*dst = *src
|
|
|
|
dst.Values = append(src.Values[:0:0], src.Values...)
|
2023-09-30 01:15:53 +00:00
|
|
|
if src.ValuePointers != nil {
|
|
|
|
dst.ValuePointers = make([]*StructWithoutPtrs, len(src.ValuePointers))
|
|
|
|
for i := range dst.ValuePointers {
|
2024-07-08 15:11:00 +00:00
|
|
|
if src.ValuePointers[i] == nil {
|
|
|
|
dst.ValuePointers[i] = nil
|
|
|
|
} else {
|
|
|
|
dst.ValuePointers[i] = ptr.To(*src.ValuePointers[i])
|
|
|
|
}
|
2023-09-30 01:15:53 +00:00
|
|
|
}
|
2022-05-01 23:15:20 +00:00
|
|
|
}
|
2023-09-30 01:15:53 +00:00
|
|
|
if src.StructPointers != nil {
|
|
|
|
dst.StructPointers = make([]*StructWithPtrs, len(src.StructPointers))
|
|
|
|
for i := range dst.StructPointers {
|
2024-07-08 15:11:00 +00:00
|
|
|
if src.StructPointers[i] == nil {
|
|
|
|
dst.StructPointers[i] = nil
|
|
|
|
} else {
|
|
|
|
dst.StructPointers[i] = src.StructPointers[i].Clone()
|
|
|
|
}
|
2023-09-30 01:15:53 +00:00
|
|
|
}
|
2022-05-01 23:15:20 +00:00
|
|
|
}
|
2024-07-08 15:11:00 +00:00
|
|
|
dst.Slice = append(src.Slice[:0:0], src.Slice...)
|
|
|
|
dst.Prefixes = append(src.Prefixes[:0:0], src.Prefixes...)
|
|
|
|
dst.Data = append(src.Data[:0:0], src.Data...)
|
2023-09-30 01:15:53 +00:00
|
|
|
if src.Structs != nil {
|
|
|
|
dst.Structs = make([]StructWithPtrs, len(src.Structs))
|
|
|
|
for i := range dst.Structs {
|
|
|
|
dst.Structs[i] = *src.Structs[i].Clone()
|
|
|
|
}
|
2022-05-01 23:15:20 +00:00
|
|
|
}
|
2023-09-30 01:15:53 +00:00
|
|
|
if src.Ints != nil {
|
|
|
|
dst.Ints = make([]*int, len(src.Ints))
|
|
|
|
for i := range dst.Ints {
|
2023-09-30 01:31:45 +00:00
|
|
|
if src.Ints[i] == nil {
|
|
|
|
dst.Ints[i] = nil
|
|
|
|
} else {
|
|
|
|
dst.Ints[i] = ptr.To(*src.Ints[i])
|
|
|
|
}
|
2023-09-30 01:15:53 +00:00
|
|
|
}
|
2022-05-01 23:15:20 +00:00
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _StructWithSlicesCloneNeedsRegeneration = StructWithSlices(struct {
|
|
|
|
Values []StructWithoutPtrs
|
|
|
|
ValuePointers []*StructWithoutPtrs
|
|
|
|
StructPointers []*StructWithPtrs
|
|
|
|
Slice []string
|
2022-07-25 03:08:42 +00:00
|
|
|
Prefixes []netip.Prefix
|
2022-05-01 23:15:20 +00:00
|
|
|
Data []byte
|
2024-07-08 15:11:00 +00:00
|
|
|
Structs []StructWithPtrs
|
|
|
|
Ints []*int
|
2022-05-01 23:15:20 +00:00
|
|
|
}{})
|
2022-08-17 21:56:56 +00:00
|
|
|
|
|
|
|
// Clone makes a deep copy of OnlyGetClone.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *OnlyGetClone) Clone() *OnlyGetClone {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(OnlyGetClone)
|
|
|
|
*dst = *src
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _OnlyGetCloneCloneNeedsRegeneration = OnlyGetClone(struct {
|
|
|
|
SinViewerPorFavor bool
|
|
|
|
}{})
|
2023-05-09 22:35:47 +00:00
|
|
|
|
|
|
|
// Clone makes a deep copy of StructWithEmbedded.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *StructWithEmbedded) Clone() *StructWithEmbedded {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(StructWithEmbedded)
|
|
|
|
*dst = *src
|
|
|
|
dst.A = src.A.Clone()
|
|
|
|
dst.StructWithSlices = *src.StructWithSlices.Clone()
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _StructWithEmbeddedCloneNeedsRegeneration = StructWithEmbedded(struct {
|
|
|
|
A *StructWithPtrs
|
|
|
|
StructWithSlices
|
|
|
|
}{})
|
2024-07-08 15:11:00 +00:00
|
|
|
|
|
|
|
// Clone makes a deep copy of GenericIntStruct.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *GenericIntStruct[T]) Clone() *GenericIntStruct[T] {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(GenericIntStruct[T])
|
|
|
|
*dst = *src
|
|
|
|
if dst.Pointer != nil {
|
|
|
|
dst.Pointer = ptr.To(*src.Pointer)
|
|
|
|
}
|
|
|
|
dst.Slice = append(src.Slice[:0:0], src.Slice...)
|
|
|
|
dst.Map = maps.Clone(src.Map)
|
|
|
|
if src.PtrSlice != nil {
|
|
|
|
dst.PtrSlice = make([]*T, len(src.PtrSlice))
|
|
|
|
for i := range dst.PtrSlice {
|
|
|
|
if src.PtrSlice[i] == nil {
|
|
|
|
dst.PtrSlice[i] = nil
|
|
|
|
} else {
|
|
|
|
dst.PtrSlice[i] = ptr.To(*src.PtrSlice[i])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst.PtrKeyMap = maps.Clone(src.PtrKeyMap)
|
|
|
|
if dst.PtrValueMap != nil {
|
|
|
|
dst.PtrValueMap = map[string]*T{}
|
|
|
|
for k, v := range src.PtrValueMap {
|
|
|
|
if v == nil {
|
|
|
|
dst.PtrValueMap[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.PtrValueMap[k] = ptr.To(*v)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.SliceMap != nil {
|
|
|
|
dst.SliceMap = map[string][]T{}
|
|
|
|
for k := range src.SliceMap {
|
|
|
|
dst.SliceMap[k] = append([]T{}, src.SliceMap[k]...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
func _GenericIntStructCloneNeedsRegeneration[T constraints.Integer](GenericIntStruct[T]) {
|
|
|
|
_GenericIntStructCloneNeedsRegeneration(struct {
|
|
|
|
Value T
|
|
|
|
Pointer *T
|
|
|
|
Slice []T
|
|
|
|
Map map[string]T
|
|
|
|
PtrSlice []*T
|
|
|
|
PtrKeyMap map[*T]string `json:"-"`
|
|
|
|
PtrValueMap map[string]*T
|
|
|
|
SliceMap map[string][]T
|
|
|
|
}{})
|
|
|
|
}
|
|
|
|
|
|
|
|
// Clone makes a deep copy of GenericNoPtrsStruct.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *GenericNoPtrsStruct[T]) Clone() *GenericNoPtrsStruct[T] {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(GenericNoPtrsStruct[T])
|
|
|
|
*dst = *src
|
|
|
|
if dst.Pointer != nil {
|
|
|
|
dst.Pointer = ptr.To(*src.Pointer)
|
|
|
|
}
|
|
|
|
dst.Slice = append(src.Slice[:0:0], src.Slice...)
|
|
|
|
dst.Map = maps.Clone(src.Map)
|
|
|
|
if src.PtrSlice != nil {
|
|
|
|
dst.PtrSlice = make([]*T, len(src.PtrSlice))
|
|
|
|
for i := range dst.PtrSlice {
|
|
|
|
if src.PtrSlice[i] == nil {
|
|
|
|
dst.PtrSlice[i] = nil
|
|
|
|
} else {
|
|
|
|
dst.PtrSlice[i] = ptr.To(*src.PtrSlice[i])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst.PtrKeyMap = maps.Clone(src.PtrKeyMap)
|
|
|
|
if dst.PtrValueMap != nil {
|
|
|
|
dst.PtrValueMap = map[string]*T{}
|
|
|
|
for k, v := range src.PtrValueMap {
|
|
|
|
if v == nil {
|
|
|
|
dst.PtrValueMap[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.PtrValueMap[k] = ptr.To(*v)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.SliceMap != nil {
|
|
|
|
dst.SliceMap = map[string][]T{}
|
|
|
|
for k := range src.SliceMap {
|
|
|
|
dst.SliceMap[k] = append([]T{}, src.SliceMap[k]...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
func _GenericNoPtrsStructCloneNeedsRegeneration[T StructWithoutPtrs | netip.Prefix | BasicType](GenericNoPtrsStruct[T]) {
|
|
|
|
_GenericNoPtrsStructCloneNeedsRegeneration(struct {
|
|
|
|
Value T
|
|
|
|
Pointer *T
|
|
|
|
Slice []T
|
|
|
|
Map map[string]T
|
|
|
|
PtrSlice []*T
|
|
|
|
PtrKeyMap map[*T]string `json:"-"`
|
|
|
|
PtrValueMap map[string]*T
|
|
|
|
SliceMap map[string][]T
|
|
|
|
}{})
|
|
|
|
}
|
|
|
|
|
|
|
|
// Clone makes a deep copy of GenericCloneableStruct.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *GenericCloneableStruct[T, V]) Clone() *GenericCloneableStruct[T, V] {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(GenericCloneableStruct[T, V])
|
|
|
|
*dst = *src
|
|
|
|
dst.Value = src.Value.Clone()
|
|
|
|
if src.Slice != nil {
|
|
|
|
dst.Slice = make([]T, len(src.Slice))
|
|
|
|
for i := range dst.Slice {
|
|
|
|
dst.Slice[i] = src.Slice[i].Clone()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.Map != nil {
|
|
|
|
dst.Map = map[string]T{}
|
|
|
|
for k, v := range src.Map {
|
|
|
|
dst.Map[k] = v.Clone()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.Pointer != nil {
|
|
|
|
dst.Pointer = ptr.To((*src.Pointer).Clone())
|
|
|
|
}
|
|
|
|
if src.PtrSlice != nil {
|
|
|
|
dst.PtrSlice = make([]*T, len(src.PtrSlice))
|
|
|
|
for i := range dst.PtrSlice {
|
|
|
|
if src.PtrSlice[i] == nil {
|
|
|
|
dst.PtrSlice[i] = nil
|
|
|
|
} else {
|
|
|
|
dst.PtrSlice[i] = ptr.To((*src.PtrSlice[i]).Clone())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst.PtrKeyMap = maps.Clone(src.PtrKeyMap)
|
|
|
|
if dst.PtrValueMap != nil {
|
|
|
|
dst.PtrValueMap = map[string]*T{}
|
|
|
|
for k, v := range src.PtrValueMap {
|
|
|
|
if v == nil {
|
|
|
|
dst.PtrValueMap[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.PtrValueMap[k] = ptr.To((*v).Clone())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.SliceMap != nil {
|
|
|
|
dst.SliceMap = map[string][]T{}
|
|
|
|
for k := range src.SliceMap {
|
|
|
|
dst.SliceMap[k] = append([]T{}, src.SliceMap[k]...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
func _GenericCloneableStructCloneNeedsRegeneration[T views.ViewCloner[T, V], V views.StructView[T]](GenericCloneableStruct[T, V]) {
|
|
|
|
_GenericCloneableStructCloneNeedsRegeneration(struct {
|
|
|
|
Value T
|
|
|
|
Slice []T
|
|
|
|
Map map[string]T
|
|
|
|
Pointer *T
|
|
|
|
PtrSlice []*T
|
|
|
|
PtrKeyMap map[*T]string `json:"-"`
|
|
|
|
PtrValueMap map[string]*T
|
|
|
|
SliceMap map[string][]T
|
|
|
|
}{})
|
|
|
|
}
|
2024-07-14 16:45:55 +00:00
|
|
|
|
|
|
|
// Clone makes a deep copy of StructWithContainers.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *StructWithContainers) Clone() *StructWithContainers {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(StructWithContainers)
|
|
|
|
*dst = *src
|
|
|
|
dst.CloneableContainer = *src.CloneableContainer.Clone()
|
2024-08-14 20:06:50 +00:00
|
|
|
dst.CloneableGenericContainer = *src.CloneableGenericContainer.Clone()
|
|
|
|
dst.CloneableMap = *src.CloneableMap.Clone()
|
|
|
|
dst.CloneableGenericMap = *src.CloneableGenericMap.Clone()
|
2024-07-14 16:45:55 +00:00
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _StructWithContainersCloneNeedsRegeneration = StructWithContainers(struct {
|
2024-08-14 20:06:50 +00:00
|
|
|
IntContainer Container[int]
|
|
|
|
CloneableContainer Container[*StructWithPtrs]
|
|
|
|
BasicGenericContainer Container[GenericBasicStruct[int]]
|
|
|
|
CloneableGenericContainer Container[*GenericNoPtrsStruct[int]]
|
|
|
|
CloneableMap MapContainer[int, *StructWithPtrs]
|
|
|
|
CloneableGenericMap MapContainer[int, *GenericNoPtrsStruct[int]]
|
2024-07-14 16:45:55 +00:00
|
|
|
}{})
|