- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 217 for elem4 (0.04 sec)
-
test/typeparam/sets.go
// _Make makes a new set. func _Make[Elem comparable]() _Set[Elem] { return _Set[Elem]{m: make(map[Elem]struct{})} } // Add adds an element to a set. func (s _Set[Elem]) Add(v Elem) { s.m[v] = struct{}{} } // Delete removes an element from a set. If the element is not present // in the set, this does nothing. func (s _Set[Elem]) Delete(v Elem) { delete(s.m, v) } // Contains reports whether v is in the set.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 5.7K bytes - Viewed (0) -
operator/pkg/util/reflect.go
return kindOf(v) == reflect.Ptr && reflect.TypeOf(v).Elem().Kind() == reflect.Slice } // IsSliceInterfacePtr reports whether v is a slice ptr type. func IsSliceInterfacePtr(v any) bool { // Must use ValueOf because Elem().Elem() type resolves dynamically. vv := reflect.ValueOf(v) return vv.Kind() == reflect.Ptr && vv.Elem().Kind() == reflect.Interface && vv.Elem().Elem().Kind() == reflect.Slice }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 8.6K bytes - Viewed (0) -
test/fixedbugs/issue53702.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main type Elem struct{} func (*Elem) Wait(callback func()) {} type Base struct { elem [8]*Elem } var g_val = 1 func (s *Base) Do() *int { resp := &g_val for _, e := range s.elem { e.Wait(func() { *resp = 0 }) } return resp } type Sub struct { *Base }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Aug 14 00:14:04 UTC 2022 - 551 bytes - Viewed (0) -
src/go/types/map.go
// A Map represents a map type. type Map struct { key, elem Type } // NewMap returns a new map for the given key and element types. func NewMap(key, elem Type) *Map { return &Map{key: key, elem: elem} } // Key returns the key type of map m. func (m *Map) Key() Type { return m.key } // Elem returns the element type of map m. func (m *Map) Elem() Type { return m.elem } func (t *Map) Underlying() Type { return t }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 781 bytes - Viewed (0) -
src/go/types/chan.go
// Dir returns the direction of channel c. func (c *Chan) Dir() ChanDir { return c.dir } // Elem returns the element type of channel c. func (c *Chan) Elem() Type { return c.elem } func (c *Chan) Underlying() Type { return c }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 1K bytes - Viewed (0) -
src/reflect/nih_test.go
v := ValueOf((*nih)(nil)) v.Elem() shouldPanic("reflect: call of reflect.Value.Field on zero Value", func() { v.Elem().Field(0) }) v = ValueOf(&global_nih) if got := v.Elem().Field(1).Int(); got != 7 { t.Fatalf("got %d, want 7", got) } v = ValueOf((*nih)(unsafe.Pointer(new(int)))) shouldPanic("reflect: reflect.Value.Elem on an invalid notinheap pointer", func() { v.Elem() })
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Aug 31 01:16:54 UTC 2022 - 1004 bytes - Viewed (0) -
src/go/types/slice.go
package types // A Slice represents a slice type. type Slice struct { elem Type } // NewSlice returns a new slice type for the given element type. func NewSlice(elem Type) *Slice { return &Slice{elem: elem} } // Elem returns the element type of slice s. func (s *Slice) Elem() Type { return s.elem } func (s *Slice) Underlying() Type { return s }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 701 bytes - Viewed (0) -
src/go/types/pointer.go
type Pointer struct { base Type // element type } // NewPointer returns a new pointer type for the given element (base) type. func NewPointer(elem Type) *Pointer { return &Pointer{base: elem} } // Elem returns the element type for the given pointer p. func (p *Pointer) Elem() Type { return p.base } func (p *Pointer) Underlying() Type { return p }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 761 bytes - Viewed (0) -
test/typeparam/orderedmapsimp.dir/a.go
// the receiver stops reading them. func Ranger[Elem any]() (*Sender[Elem], *Receiver[Elem]) { c := make(chan Elem) d := make(chan struct{}) s := &Sender[Elem]{ values: c, done: d, } r := &Receiver[Elem]{ values: c, done: d, } runtime.SetFinalizer(r, (*Receiver[Elem]).finalize) return s, r } // A Sender is used to send values to a Receiver.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jul 28 21:40:40 UTC 2021 - 5.5K bytes - Viewed (0) -
src/internal/types/testdata/examples/inference.go
// last. related2(1.2, []float64{}) related2(1.0, []int{}) related2 /* ERROR "Slice (type []int) does not satisfy interface{[]Elem}" */ (float64(1.0), []int{}) // TODO(gri) better error message } type List[P any] []P func related3[Elem any, Slice []Elem | List[Elem]]() Slice { return nil } func _() { // related3 can be instantiated explicitly related3[int, []int]() related3[byte, List[byte]]()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Jun 02 16:49:45 UTC 2023 - 4.3K bytes - Viewed (0)