Re: [boost] [Review] optional exceptions

David Abrahams writes:
Ion GaztaƱaga <igaztanaga@gmail.com> writes:
but I suppose that the code must mark some "check-points" to know how many object are already constructed, to know how many destructors it must call when the exception occurs. I suppose that can be implemented as an integer/pointer increment or assignment. But the code must add something to the normal path to know what to do when the exception occurs.
No. All the necessary information is contained in the program counter at the point where the exception is thrown.
This is being VERY picky, but strictly speaking the information is contained in the program counter *and all the return addresses on the call stack*. -- Martin Bonner Martin.Bonner@Pitechnology.com Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 203894

"Martin Bonner" <martin.bonner@pitechnology.com> writes:
David Abrahams writes:
Ion GaztaƱaga <igaztanaga@gmail.com> writes:
but I suppose that the code must mark some "check-points" to know how many object are already constructed, to know how many destructors it must call when the exception occurs. I suppose that can be implemented as an integer/pointer increment or assignment. But the code must add something to the normal path to know what to do when the exception occurs.
No. All the necessary information is contained in the program counter at the point where the exception is thrown.
This is being VERY picky, but strictly speaking the information is contained in the program counter *and all the return addresses on the call stack*.
Yes, thank you for picking. And the registers. :) -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams
-
Martin Bonner