std::addressof does not inflict any penalty. When it comes down to assembler, we still refer only to objects at their addresses, so the information is already at hand.
As for operator& , it depends on whether it was overloaded or not. The original, non-overloaded version behaves exactly like std::addressof . However, if operator& was overloaded (this is a very bad idea, and really didnโt like it), all bets are disabled, since we cannot guess what an overloaded implementation is.
So, the answer to your question: there is no need to store pointers separately, you can just use std::addressof or operator& whenever you need it, even if you need to repeat it.
source share