diff options
author | Aaron <aaron@10gen.com> | 2009-02-20 10:48:32 -0500 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2009-02-20 10:48:32 -0500 |
commit | 6f25a72ec32be1dd6602e7fa5394ce9706c0242e (patch) | |
tree | 2bfc2145b12d6698156d16749809ab3732b39cce /stdafx.h | |
parent | 406442dec4ee513d5f68971e22d2e9acfd0c56a2 (diff) | |
download | mongo-6f25a72ec32be1dd6602e7fa5394ce9706c0242e.tar.gz |
'better' LazyString
Diffstat (limited to 'stdafx.h')
-rw-r--r-- | stdafx.h | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -70,12 +70,6 @@ using namespace std; namespace mongo { - class Stringable { - public: - virtual ~Stringable() throw() {} - virtual string toString() const = 0; - }; - /* these are manipulated outside of mutexes, so be careful */ struct Assertion { Assertion() { @@ -113,12 +107,13 @@ namespace mongo { /* last assert of diff types: regular, wassert, msgassert, uassert: */ extern Assertion lastAssert[4]; - class DBException : public exception, public Stringable { + class DBException : public exception { public: virtual const char* what() const throw() = 0; virtual string toString() const { return what(); } + operator string() const { return toString(); } }; class AssertionException : public DBException { |