Want to understand C++ sentry object
- by Romain Hippeau
I answered this [question][1] and somebody else had answered as
he modern C++ equivalent would be a
sentry object: construct it at the
beginning of a function, with its
constructor implementing call(), and
upon return (or abnormal exit), its
destructor implements
I am not familiar with using sentry objects in C++.
I thought they were limited to input and output streams.
Could somebody explain to me about C++ sentry objects as well as how to use them as an around interceptor for one or more methods in a class ?
[1]: http://stackoverflow.com/questions/2688043/call-return-feature-of-classic-cc-with-classes-what-modern-languages-have-it/2688095#2688095 /