Skip to content

Commit 18ce69e

Browse files
aathanLeo Alt
authored andcommitted
Update reference-types.rst
1 parent 681581d commit 18ce69e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/types/reference-types.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ Data locations are not only relevant for persistency of data, but also for the s
8585
// The following does not work; it would need to create a new temporary /
8686
// unnamed array in storage, but storage is "statically" allocated:
8787
// y = memoryArray;
88-
// This does not work either, since it would "reset" the pointer, but there
89-
// is no sensible location it could point to.
88+
// On the other hand: "delete y" is not valid, as assignments to local variables
89+
// referencing storage objects can only be made from existing storage objects.
90+
// It would "reset" the pointer, but there is no sensible location it could point to.
91+
// See "delete" under Operators
9092
// delete y;
9193
g(x); // calls g, handing over a reference to x
9294
h(x); // calls h and creates an independent, temporary copy in memory

0 commit comments

Comments
 (0)