Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / AutoDispose.h
index 9c85fea..bb01549 100644 (file)
@@ -33,10 +33,10 @@ namespace zypp
    *
    * \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>.
+   * should be immutable, you should use <tt>AutoDispose\<const _Tp\></tt>.
    *
    * Pass a filename to the application and provide the appropriate
-   * code to be exectued when the file is no longer needed:
+   * code to be executed when the file is no longer needed:
    * \code
    * struct FileCache
    * {
@@ -108,8 +108,13 @@ namespace zypp
       : _pimpl( new Impl( value_type() ) )
       {}
 
+      /** Ctor taking dispose function and using default constructed value. */
+      explicit AutoDispose( const Dispose & dispose_r )
+      : _pimpl( new Impl( value_type(), dispose_r ) )
+      {}
+
       /** Ctor taking value and no dispose function. */
-      AutoDispose( param_type value_r )
+      explicit AutoDispose( param_type value_r )
       : _pimpl( new Impl( value_r ) )
       {}
 
@@ -132,7 +137,7 @@ namespace zypp
       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; }