diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-11-08 21:54:52 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-11-08 21:54:52 +0000 |
commit | c5628db861b753d1eeaf67c2f5c05f4f31d2dfda (patch) | |
tree | 96b9adb8450361df1e8060aaa33a71d36c931413 | |
parent | Add exception helper (diff) | |
download | libadhocutil-0.2.1.tar.bz2 libadhocutil-0.2.1.tar.xz libadhocutil-0.2.1.zip |
Add doxygen commentslibadhocutil-0.2.1
-rw-r--r-- | libadhocutil/exception.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libadhocutil/exception.h b/libadhocutil/exception.h index a63439b..fd4263c 100644 --- a/libadhocutil/exception.h +++ b/libadhocutil/exception.h @@ -6,9 +6,11 @@ #include <boost/optional.hpp> namespace AdHoc { + /// Helper class for lazy creation of exception message text. template <typename BaseException> class Exception : public BaseException { public: + /// Override of std::exception::what() to create text as required. inline const char * what() const throw() override { if (!msg) { @@ -18,6 +20,7 @@ namespace AdHoc { } private: + /// Message text provider. virtual std::string message() const throw() = 0; mutable boost::optional<std::string> msg; }; |