Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for _Copy (0.05 sec)

  1. test/typeparam/maps.go

    	}
    }
    
    func TestCopy() {
    	m2 := _Copy(m1)
    	if !_Equal(m1, m2) {
    		panic(fmt.Sprintf("_Copy(%v) = %v, want %v", m1, m2, m1))
    	}
    	m2[16] = 32
    	if _Equal(m1, m2) {
    		panic(fmt.Sprintf("_Equal(%v, %v) = true, want false", m1, m2))
    	}
    }
    
    func TestAdd() {
    	mc := _Copy(m1)
    	_Add(mc, mc)
    	if !_Equal(mc, m1) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  2. test/typeparam/slices.go

    		s = s[:tot]
    	} else {
    		news := make([]T, tot, tot+tot/2)
    		_Copy(news, s)
    		s = news
    	}
    	_Copy(s[lens:tot], t)
    	return s
    }
    
    // _Copy copies values from t to s, stopping when either slice is full,
    // returning the number of values copied. This is like the predeclared
    // copy function; it's an example of how to write it using generics.
    func _Copy[T any](s, t []T) int {
    	i := 0
    	for ; i < len(s) && i < len(t); i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 7.8K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/universe.go

    }
    
    // A builtinId is the id of a builtin function.
    type builtinId int
    
    const (
    	// universe scope
    	_Append builtinId = iota
    	_Cap
    	_Clear
    	_Close
    	_Complex
    	_Copy
    	_Delete
    	_Imag
    	_Len
    	_Make
    	_Max
    	_Min
    	_New
    	_Panic
    	_Print
    	_Println
    	_Real
    	_Recover
    
    	// package unsafe
    	_Add
    	_Alignof
    	_Offsetof
    	_Sizeof
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  4. src/go/types/universe.go

    }
    
    // A builtinId is the id of a builtin function.
    type builtinId int
    
    const (
    	// universe scope
    	_Append builtinId = iota
    	_Cap
    	_Clear
    	_Close
    	_Complex
    	_Copy
    	_Delete
    	_Imag
    	_Len
    	_Make
    	_Max
    	_Min
    	_New
    	_Panic
    	_Print
    	_Println
    	_Real
    	_Recover
    
    	// package unsafe
    	_Add
    	_Alignof
    	_Offsetof
    	_Sizeof
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  5. src/sort/sort_test.go

    		}
    		b.StartTimer()
    		Stable(IntSlice(data))
    		b.StopTimer()
    	}
    }
    
    const (
    	_Sawtooth = iota
    	_Rand
    	_Stagger
    	_Plateau
    	_Shuffle
    	_NDist
    )
    
    const (
    	_Copy = iota
    	_Reverse
    	_ReverseFirstHalf
    	_ReverseSecondHalf
    	_Sorted
    	_Dither
    	_NMode
    )
    
    type testingData struct {
    	desc        string
    	t           *testing.T
    	data        []int
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:41:04 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  6. src/go/types/builtins.go

    		} else {
    			x.mode = value
    		}
    
    		if check.recordTypes() && x.mode != constant_ {
    			check.recordBuiltinType(call.Fun, makeSig(resTyp, x.typ, x.typ))
    		}
    
    		x.typ = resTyp
    
    	case _Copy:
    		// copy(x, y []T) int
    		dst, _ := coreType(x.typ).(*Slice)
    
    		y := args[1]
    		src0 := coreString(y.typ)
    		if src0 != nil && isString(src0) {
    			src0 = NewSlice(universeByte)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/builtins.go

    		} else {
    			x.mode = value
    		}
    
    		if check.recordTypes() && x.mode != constant_ {
    			check.recordBuiltinType(call.Fun, makeSig(resTyp, x.typ, x.typ))
    		}
    
    		x.typ = resTyp
    
    	case _Copy:
    		// copy(x, y []T) int
    		dst, _ := coreType(x.typ).(*Slice)
    
    		y := args[1]
    		src0 := coreString(y.typ)
    		if src0 != nil && isString(src0) {
    			src0 = NewSlice(universeByte)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
Back to top