I am familiar with the mental model of a C++ exception, and how it can be controlled programatically. For example, everything in this answer :SO Question on topic
What bewilders me, however, is how the exception object is preserved(what a catch is able to intercept), if it is value instantiated in the throwing stack frame, and the current, and an arbitrary number of preceding, frames are unwound, with all owning locals destructed(if written with RAII) compliance. To make matters less decipherable, the advised pattern is to throw by value, and to catch by const&...a value whose stack is gone?...reference to a potentially unnamed value on a long ago destroyed frame? I am obviously missing something. References to exited-local-function-objects is a classic novice mistake, yet in this case, it is recommended. I speculate the throw catch pattern intermixed with user code is an illusion, with an implementation that is entirely different,but that leaves me wondering still, where is the (implicitly not heap allocated) exception object stored, so it can be caught at a runtime-variable location, given the fact that the stackframe within which its value is seemingly stored is destined for immediate unwinding?
Edit: Some tangential questions inspired by @RichardCritten's 'implementation detail response: What if an exception object is instantiated as an l-value, and not thrown? What if such an l-value is parameterized and argued, then thrown by another function(is it guaranteed to still know the throw context)? What if the object is allocated with new, and its reference used to throw? Are you forced to 'just use exceptions as advised, and trust they will behave as the standard mandates'?