How do I decide whether I need addressof(x)
instead of &x
when taking the address of an object?
Seems like the question was confusing, so a clarification is in order:
addressof
obviously bypasses the overloaded address-of operator. I'm already aware of that.
What I want to know is:
How do I know if that's what I really want to do? (Especially when inside a template, etc.)
Is there some kind of "rule" that helps me figure out when I need addressof
instead of &
?
After all, they both return the "address of" the object, so when do I use which?