From 204f915b9c5516789bdbbe9a0f2e815b8ef04a65 Mon Sep 17 00:00:00 2001 From: Andreas Waidler Date: Mon, 8 Mar 2010 18:21:38 +0100 Subject: [PATCH] Added throw specification. --- include/libsex/Exception.hxx | 4 ++-- include/libsex/utility.hxx | 6 +++--- include/libsex/utility.ixx | 2 +- src/Exception.cxx | 4 ++-- src/utility.cxx | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/libsex/Exception.hxx b/include/libsex/Exception.hxx index 7d4a06c..fc9a738 100644 --- a/include/libsex/Exception.hxx +++ b/include/libsex/Exception.hxx @@ -36,8 +36,8 @@ public: const Exception& previous) throw(); virtual ~Exception() throw(); - void write(std::ostream& out) const; - void backtrace(std::ostream& out) const; + void write(std::ostream& out) const throw(std::ios_base::failure); + void backtrace(std::ostream& out) const throw(std::ios_base::failure); virtual const Exception* clone() const throw(std::bad_alloc) ; diff --git a/include/libsex/utility.hxx b/include/libsex/utility.hxx index 8218a85..54f98ae 100644 --- a/include/libsex/utility.hxx +++ b/include/libsex/utility.hxx @@ -28,7 +28,7 @@ bool vformat( const char* const file, unsigned short line, const char* const message, - va_list ap); + va_list ap) throw(); /** * @brief Same as the vformat() but uses "real" variadic @@ -40,7 +40,7 @@ bool format( const char* const file, unsigned short line, const char* const message, - ...); + ...) throw(); /** * @brief Instanciates T with properly formatted message. @@ -56,7 +56,7 @@ bool format( * @return Instance of T. */ template -T formatted(const char* const file, unsigned short line, ...); +T formatted(const char* const file, unsigned short line, ...) throw(); }; // namespace diff --git a/include/libsex/utility.ixx b/include/libsex/utility.ixx index 6bee998..c3ebeb6 100644 --- a/include/libsex/utility.ixx +++ b/include/libsex/utility.ixx @@ -5,7 +5,7 @@ namespace libsex { template T formatted(const char* const file, unsigned short line, - ...) + ...) throw() { // Temporary string should be initialized // with 0 to not forget a trailing 0. diff --git a/src/Exception.cxx b/src/Exception.cxx index 8a46d08..6348dd2 100644 --- a/src/Exception.cxx +++ b/src/Exception.cxx @@ -43,12 +43,12 @@ Exception::~Exception() throw() if (_previous) delete _previous; } -void Exception::write(std::ostream& out) const +void Exception::write(std::ostream& out) const throw(std::ios_base::failure) { out << what(); } -void Exception::backtrace(std::ostream& out) const +void Exception::backtrace(std::ostream& out) const throw(std::ios_base::failure) { write(out); if (_previous != 0) { diff --git a/src/utility.cxx b/src/utility.cxx index be38298..bda28a7 100644 --- a/src/utility.cxx +++ b/src/utility.cxx @@ -9,7 +9,7 @@ bool vformat( const char* const file, unsigned short line, const char* const message, - va_list ap) + va_list ap) throw() { size_t chars = snprintf( @@ -42,7 +42,7 @@ bool format( const char* const file, unsigned short line, const char* const message, - ...) + ...) throw() { va_list ap; va_start(ap, message); -- 2.11.4.GIT