No, I don't believe so. You bound 5
to the reference that's the argument to fun
, so it lasts for as long as that argument lasts. The argument only lasts for the duration of the call to fun
.
The relevant standard text was explored in this previous question.