From d6446d1cfb30f9e96d4ee8ca8e46117ec364cc74 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 4 Sep 2008 17:36:56 +0000 Subject: [PATCH] Add error_code throws [SVN r48577] --- include/boost/system/error_code.hpp | 3 +++ src/error_code.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/include/boost/system/error_code.hpp b/include/boost/system/error_code.hpp index a5db008..9f5a207 100644 --- a/include/boost/system/error_code.hpp +++ b/include/boost/system/error_code.hpp @@ -382,6 +382,9 @@ namespace boost }; + // predefined error_code object used as "throw on error" tag + BOOST_SYSTEM_DECL extern error_code throws; + // non-member functions ------------------------------------------------// inline bool operator!=( const error_code & lhs, diff --git a/src/error_code.cpp b/src/error_code.cpp index f2623fc..3c4c762 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -396,6 +396,12 @@ namespace boost namespace system { + BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code; + // note that it doesn't matter if this + // isn't initialized before use since + // the only use is to take its + // address for comparison purposes + BOOST_SYSTEM_DECL const error_category & get_system_category() { static const system_error_category system_category_const;