diff options
Diffstat (limited to 'examples/IPC_SAP/UPIPE_SAP/auto_builtin_ptr.h')
-rw-r--r-- | examples/IPC_SAP/UPIPE_SAP/auto_builtin_ptr.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/IPC_SAP/UPIPE_SAP/auto_builtin_ptr.h b/examples/IPC_SAP/UPIPE_SAP/auto_builtin_ptr.h new file mode 100644 index 00000000000..3dd22c04967 --- /dev/null +++ b/examples/IPC_SAP/UPIPE_SAP/auto_builtin_ptr.h @@ -0,0 +1,20 @@ +/* -*- C++ -*- */ +// @(#)auto_builtin_ptr.h 1.1 10/18/96 + +template <class X> +class auto_builtin_ptr + // = TITLE + // Implements an simple-minded auto_ptr abstraction for builtin types. +{ +public: + // = Initialization and termination methods + auto_builtin_ptr (X *p = 0): p_ (p) {} + ~auto_builtin_ptr (void) { delete [] this->p_; } + + // = Accessor methods. + operator X * (void) const { return this->p_; } + +private: + X *p_; +}; + |