From d0f5817f4720b49ffaee9fa9593b2f11446963a0 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Thu, 18 Feb 2016 21:39:06 -0500 Subject: Add nullary constructor to IoError The constructor constructs an IoError based on the current errno. --- src/posix_extras.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/posix_extras.h') diff --git a/src/posix_extras.h b/src/posix_extras.h index b9c0f12..001968f 100644 --- a/src/posix_extras.h +++ b/src/posix_extras.h @@ -15,6 +15,7 @@ #ifndef POSIX_EXTRAS_H_ #define POSIX_EXTRAS_H_ +#include #include #include @@ -26,6 +27,8 @@ namespace scoville { class IoError : public std::runtime_error { public: + IoError() : IoError(errno) {} + explicit IoError(const int number) : std::runtime_error(Message(number)), number_(number) {} -- cgit v1.2.3