summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-01-26 11:43:43 -0500
committerEliot Horowitz <eliot@10gen.com>2011-01-26 11:43:43 -0500
commit7e0285040eb8754f2b4e72d18bf072fbd3af82fc (patch)
treedc12c93ae2254c5ffab70374486f6e79687b7b4d
parent6001665cee7d1dfd04d97058691c9d72ac190150 (diff)
downloadmongo-7e0285040eb8754f2b4e72d18bf072fbd3af82fc.tar.gz
fix log with shared_ptr
-rw-r--r--util/log.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/util/log.h b/util/log.h
index 03e762a2487..86aae1c326d 100644
--- a/util/log.h
+++ b/util/log.h
@@ -135,18 +135,25 @@ namespace mongo {
}
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 ) ) );
}
+
virtual Nullstream& operator<< (ostream& ( *endl )(ostream&)) {
return *this;
}
virtual Nullstream& operator<< (ios_base& (*hex)(ios_base&)) {
return *this;
}
+
virtual void flush(Tee *t = 0) {}
};
extern Nullstream nullstream;
@@ -228,16 +235,6 @@ namespace mongo {
return *this;
}
- template< class T >
- Nullstream& operator<<(const shared_ptr<T> p ) {
- T * t = p.get();
- if ( ! t )
- *this << "null";
- else
- *this << *t;
- return *this;
- }
-
Logstream& prolog() {
return *this;
}