> go_spec: composite literals are addressable They're not, really. Addressable means more than you can ...
13 years, 7 months ago
(2010-09-24 04:14:37 UTC)
#2
> go_spec: composite literals are addressable
They're not, really. Addressable means more than you
can take & of them. It means you can assign to one
or make a method call on one, and neither of those is true.
For example,
[2]int{1,2}[0] = 3
is illegal. The &composite-literal syntax is a special
case documented in the composite literal section:
Taking the address of a composite literal
(§Address operators) generates a unique pointer
to an instance of the literal's value.
It should probably be mentioned in the Address operators
section too, but they're not generally addressable.
Russ
Issue 2258044: code review 2258044: go_spec: composite literals are addressable
Created 13 years, 7 months ago by stephenm
Modified 1 year, 8 months ago
Reviewers:
Base URL:
Comments: 0