summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-08-17 10:46:19 -0400
committerEliot Horowitz <eliot@10gen.com>2009-08-17 10:46:19 -0400
commit3c651482c420357f1d01303d0c8dc733a6a9c21d (patch)
tree85aac59dbe6fb12f0eb3f586c5b0526373c999fb
parent0e8de9950b3c3b71471e02473ffd9d65a5fa18cc (diff)
downloadmongo-3c651482c420357f1d01303d0c8dc733a6a9c21d.tar.gz
shared_ptr support for log()
-rw-r--r--util/log.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/log.h b/util/log.h
index ff5edf983e5..7272affaff6 100644
--- a/util/log.h
+++ b/util/log.h
@@ -97,6 +97,15 @@ namespace mongo {
return operator<<( static_cast<const void*>( t ) );
}
template< class T >
+ Nullstream& operator<<(const shared_ptr<T> p ){
+ T * t = p.get();
+ if ( ! t )
+ *this << "null";
+ else
+ *this << t;
+ return *this;
+ }
+ template< class T >
Nullstream& operator<<(const T &t) {
return operator<<( static_cast<const LazyString&>( LazyStringImpl< T >( t ) ) );
}