Denial: it cannot be that, the lifetime is extended!
Anger: stupid me, this line was already suspicious!
Bargaining: what if I paid more attention... what if other paid more attention?
Depression: I still think it's impossible, what the heck?
Acceptance: OK, it's that. I must understand and learn from it!
Then it hit me!
<< In general, the lifetime of a temporary cannot be further extended by "passing it on": a second reference, initialized from the reference variable or data member to which the temporary was bound, does not affect its lifetime. >> - cppreference.com - Reference initialization
First, then second
constauto& va =
boost::get<VariantA>( // no second extension...
p.get() // first extension
);
# The context of our bughunt
* We must ship on time!
* We must ship once!
* We cannot afford a bugfix!
<br/>
* We work...
* And work...
* And ship on time!
---