///////////////////////////////////////////////////////////////////
//
- // CLASS NAME : AutoDispose<Tp>
+ // CLASS NAME : AutoDispose<_Tp>
//
- /** Reference counted access to a \c Tp object calling a custom
+ /** Reference counted access to a \c _Tp object calling a custom
* \c Dispose function when the last AutoDispose handle to it is
* destroyed or reset.
*
* \note As with pointers, constness of an \c AutoDispose object does
- * \b not apply to the stored \c Tp object. If the stored \c Tp object
- * should be immutable, you should use <tt>AutoDispose\<const Tp\></tt>.
+ * \b not apply to the stored \c _Tp object. If the stored \c _Tp object
+ * should be immutable, you should use <tt>AutoDispose\<const _Tp\></tt>.
*
* Pass a filename to the application and provide the appropriate
* code to be executed when the file is no longer needed:
* }
* \endcode
*/
- template<class Tp>
+ template<class _Tp>
class AutoDispose
{
public:
- typedef typename boost::call_traits<Tp>::param_type param_type;
- typedef typename boost::call_traits<Tp>::reference reference;
- typedef typename boost::call_traits<Tp>::const_reference const_reference;
- typedef Tp value_type;
- typedef typename boost::call_traits<Tp>::value_type result_type;
+ typedef typename boost::call_traits<_Tp>::param_type param_type;
+ typedef typename boost::call_traits<_Tp>::reference reference;
+ typedef typename boost::call_traits<_Tp>::const_reference const_reference;
+ typedef _Tp value_type;
+ typedef typename boost::call_traits<_Tp>::value_type result_type;
public:
/** Dispose function signatue. */
public:
- /** Provide implicit conversion to \c Tp\&. */
+ /** Provide implicit conversion to \c _Tp\&. */
operator reference() const
{ return _pimpl->_value; }
- /** Reference to the \c Tp object. */
+ /** Reference to the \c _Tp object. */
reference value() const
{ return _pimpl->_value; }
- /** Reference to the \c Tp object. */
+ /** Reference to the \c _Tp object. */
reference operator*() const
{ return _pimpl->_value; }
- /** Pointer to the \c Tp object (asserted to be <tt>!= NULL</tt>). */
+ /** Pointer to the \c _Tp object (asserted to be <tt>!= NULL</tt>). */
value_type * operator->() const
{ return & _pimpl->_value; }
};
///////////////////////////////////////////////////////////////////
- /** \relates AutoDispose Stream output of the \c Tp object. */
- template<class Tp>
- inline std::ostream & operator<<( std::ostream & str, const AutoDispose<Tp> & obj )
+ /** \relates AutoDispose<_Tp> Stream output of the \c _Tp object. */
+ template<class _Tp>
+ inline std::ostream & operator<<( std::ostream & str, const AutoDispose<_Tp> & obj )
{ return str << obj.value(); }
/////////////////////////////////////////////////////////////////