Transcription of Wrapping C ++ Member Function Calls - Bjarne Stroustrup
{{id}} {{{paragraph}}}
Wrapping C++ Member Function CallsBjarne StroustrupAT&T Labs - ResearchFlorham Park, New JerseyUSAABSTRACTThis paper presents a simple, general, and efficient solution to the old problem of Wrapping Calls to an object in pairs of prefix and suffix code. The solution is alsonon-intrusive, applies to existing classes, allows the use of several prefix/suffix pairs, andcan be implemented in 15 simple lines of Standard C++. A robust version of the wrapperis also presented. The claim of efficiency is backed by paper is organized around a series of examples evolving the basic idea into a finalrobust template IntroductionOften, we want to wrap a piece of code with some prefix code and some suffix code.
- 4 - 4 Suffix Unfortunately, it was not obvious how to extend the templated P Pr re ef fi ix x approach to deal with suffixes. How-ever, it can be done.
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}