- Invisible reference, footnote?
What these terms refer to?!
- What's the relation between passing by value and having a well defined address?!
[1] The footnote is just a footnote in the document most likely added for clarification. Let's look at the example below, what assembly can we expect?
struct NTD {
~NTD() {}
};
extern void foo(NTD);
int main() {
foo({});
}
compiling with -O3 generates the following assembly, as we can see the value passed to the function is not an object but rather an address (rsp), this address is an invisible reference to the object passed.
main: # @main
push rax
mov rdi, rsp
call foo(NTD)
xor eax, eax
pop rcx
ret
The above example is probably the most trivial one, it gets worse if NTD actually has some trivial members.
[2] if you pass something in a register, you can't take the address of it since it's in the register.