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;