From 038bc809cbe09a6ab3142ac54d2a951c7a11ce4b Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 3 Jul 2007 16:11:40 +0200 Subject: [PATCH] add operator << (std::ostream)for Ptr --- src/core/ptr.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/ptr.h b/src/core/ptr.h index dd664be86..c612a0211 100644 --- a/src/core/ptr.h +++ b/src/core/ptr.h @@ -143,6 +143,9 @@ T * PeekPointer (const Ptr &p); template T * GetPointer (const Ptr &p); +template +std::ostream &operator << (std::ostream &, const Ptr &p); + // allow if (sp == 0) template @@ -290,6 +293,13 @@ T * GetPointer (const Ptr &p) return p.m_ptr; } +template +std::ostream &operator << (std::ostream &os, const Ptr &p) +{ + os << PeekPointer (p); + return os; +} + template bool operator == (Ptr const &lhs, T2 const *rhs)