Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for CanAddr (0.08 sec)

  1. src/reflect/value.go

    	return *(*[]rune)(v.ptr)
    }
    
    // CanAddr reports whether the value's address can be obtained with [Value.Addr].
    // Such values are called addressable. A value is addressable if it is
    // an element of a slice, an element of an addressable array,
    // a field of an addressable struct, or the result of dereferencing a pointer.
    // If CanAddr returns false, calling [Value.Addr] will panic.
    func (v Value) CanAddr() bool {
    	return v.flag&flagAddr != 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  2. src/reflect/all_test.go

    			e0[j] = ValueOf(e)
    		}
    		// Convert extra from []int to *SliceValue.
    		e1 := ValueOf(test.extra)
    
    		// Test Append.
    		a0 := ValueOf(&test.orig).Elem()
    		have0 := Append(a0, e0...)
    		if have0.CanAddr() {
    			t.Errorf("Append #%d: have slice should not be addressable", i)
    		}
    		if !DeepEqual(have0.Interface(), want) {
    			t.Errorf("Append #%d: have %v, want %v (%p %p)", i, have0, want, test.orig, have0.Interface())
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top