From ae59c1abef371cff77ba719e6fd56a346ae1f8e5 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 5 Mar 2017 13:04:31 -0500 Subject: [PATCH] nufx error update --- NuFX/nufx_error.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/NuFX/nufx_error.h b/NuFX/nufx_error.h index f310a15..059150c 100644 --- a/NuFX/nufx_error.h +++ b/NuFX/nufx_error.h @@ -12,16 +12,29 @@ namespace std { template<> struct is_error_code_enum : public true_type {}; + template<> + struct is_error_condition_enum : public true_type {}; + } // hmm... this should not be in a namespace. inline std::error_condition make_error_condition(NuError e) { - // positive values are posix errors. return e < 0 - ? std::error_condition(e, nufx_category()); - : std::error_condition(e, std::system_category()); + ? std::error_condition(e, nufx_category()) + : std::error_condition(e, std::generic_category()) + ; +} + + +inline std::error_code make_error_code(NuError e) +{ + // positive values are posix errors. + return e < 0 + ? std::error_code(e, nufx_category()) + : std::error_code(e, std::generic_category()) + ; }