diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-08-17 10:46:19 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-08-17 10:46:19 -0400 |
commit | 3c651482c420357f1d01303d0c8dc733a6a9c21d (patch) | |
tree | 85aac59dbe6fb12f0eb3f586c5b0526373c999fb /util | |
parent | 0e8de9950b3c3b71471e02473ffd9d65a5fa18cc (diff) | |
download | mongo-3c651482c420357f1d01303d0c8dc733a6a9c21d.tar.gz |
shared_ptr support for log()
Diffstat (limited to 'util')
-rw-r--r-- | util/log.h | 9 |
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 ) ) ); } |