Feb 23, 2017

[Go] object being taking addressof must have a 'home'

Address of a temporary in Go?

The address operator returns a pointer to something having a "home".
aka. in C++ , we can't take a address of a r-value. However, we can && the r-value.

In go, taking an address of a temporary type struct is possible.
However, taking an address of a temporary literal is not possible.
(Auh, this is inconsistent to my understanding base on C++, sigh...)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.