Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for CloningMap (0.1 sec)

  1. test/typeparam/issue53087.go

    	M()
    }
    
    type S struct {
    	str string
    }
    
    func (s *S) M() {}
    
    var _ I = &S{}
    
    type CloningMap[K comparable, V any] struct {
    	inner map[K]V
    }
    
    func (cm CloningMap[K, V]) With(key K, value V) CloningMap[K, V] {
    	result := CloneBad(cm.inner)
    	result[key] = value
    	return CloningMap[K, V]{result}
    }
    
    func CloneBad[M ~map[K]V, K comparable, V any](m M) M {
    	r := make(M, len(m))
    	for k, v := range m {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 08 16:23:09 UTC 2023
    - 930 bytes
    - Viewed (0)
Back to top