template<typename TOwnable>
class alib::lang::Owner< TOwnable >
Ensures that an object of template type TOwnable is acquired and properly released when unwinding the stack. This class is meant to be allocated only on the stack and not on the heap. Therefore, the new operators are declared private.
With debug builds the constructor expects caller source information parameters file , line and func . It is convenient to use macro ALIB_CALLER_PRUNED to provide those.
Note that this type is available only if ALib Strings is included in the ALib Distribution .
- See also
- Preprocessor macros ALIB_OWN, ALIB_LOCK and ALIB_LOCK_WITH for a convenient way to use this class.
- Template Parameters
-
TOwnable | The type to own. The type needs to have methods Acquire and Release available. |
Definition at line 43 of file owner.hpp.