Specialize stream output for shared_ptr<void>
authorMichael Andres <ma@suse.de>
Tue, 22 Jul 2014 12:00:35 +0000 (14:00 +0200)
committerMichael Andres <ma@suse.de>
Tue, 22 Jul 2014 12:00:35 +0000 (14:00 +0200)
zypp/base/PtrTypes.h

index e448f52..3950a38 100644 (file)
@@ -122,6 +122,15 @@ namespace std
       return str << *obj;
     return str << std::string("NULL");
   }
+  /** \overload specialize for void */
+  template<>
+  inline std::ostream & operator<<( std::ostream & str, const zypp::shared_ptr<void> & obj )
+  {
+    if ( obj )
+      return str << (void*)obj.get();
+    return str << std::string("NULL");
+  }
+
   /** \relates zypp::shared_ptr Stream output. */
   template<class _D>
   inline std::ostream & dumpOn( std::ostream & str, const zypp::shared_ptr<_D> & obj )
@@ -130,6 +139,14 @@ namespace std
       return dumpOn( str, *obj );
     return str << std::string("NULL");
   }
+  /** \overload specialize for void */
+  template<>
+  inline std::ostream & dumpOn( std::ostream & str, const zypp::shared_ptr<void> & obj )
+  {
+    if ( obj )
+      return str << (void*)obj.get();
+    return str << std::string("NULL");
+  }
 
   /** \relates zypp::intrusive_ptr Stream output. */
   template<class _D>