lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 5771939 3/4: Use std::uncaught_exceptions() i


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 5771939 3/4: Use std::uncaught_exceptions() instead of uncaught_exception()
Date: Sat, 24 Mar 2018 08:21:47 -0400 (EDT)

branch: master
commit 57719398cdd65c486ef475da3cef776f09f5c19b
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Use std::uncaught_exceptions() instead of uncaught_exception()
    
    Amended comments as the preceding commit amended code.
---
 handle_exceptions.hpp | 5 +++--
 main_wx_test.cpp      | 2 +-
 progress_meter.hpp    | 2 +-
 wx_test_document.hpp  | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/handle_exceptions.hpp b/handle_exceptions.hpp
index 1f78147..d688c8c 100644
--- a/handle_exceptions.hpp
+++ b/handle_exceptions.hpp
@@ -84,8 +84,9 @@ class stealth_exception
 ///  - the safe default action (throwing this exception) was accepted,
 /// in which case it's pointless to repeat the same message.
 ///
-/// It may seem like a good idea to test std::uncaught_exception()
-/// right before the try block, as recommended here:
+/// It may seem like a good idea to test std::uncaught_exceptions()
+/// right before the try block, as recommended here [these references
+/// speak of the related facility deprecated by C++17]:
 ///   
http://groups.google.com/group/comp.lang.c++.moderated/msg/ec0ef69dd3949955
 ///   "Before the try-block in report_exception, query
 ///   std::uncaught_exception() to determine if an exception is
diff --git a/main_wx_test.cpp b/main_wx_test.cpp
index 09b96d6..31b35a0 100644
--- a/main_wx_test.cpp
+++ b/main_wx_test.cpp
@@ -48,7 +48,7 @@
 
 #include <algorithm>                    // sort()
 #include <cstring>                      // strcmp()
-#include <exception>                    // uncaught_exception()
+#include <exception>                    // uncaught_exceptions()
 #include <iostream>
 #include <sstream>
 #include <stdexcept>
diff --git a/progress_meter.hpp b/progress_meter.hpp
index f675626..f6b24ee 100644
--- a/progress_meter.hpp
+++ b/progress_meter.hpp
@@ -138,7 +138,7 @@
 /// is taken as a postcondition of code that uses the progress meter,
 /// so it might seem natural to test it in this class's dtor; however,
 /// the postcondition won't be established if the metered loop is
-/// exited by throwing an exception. Perhaps std::uncaught_exception
+/// exited by throwing an exception. Perhaps std::uncaught_exceptions
 /// could distinguish that special case, but as this is written in
 /// 2007-06 some compilers don't implement that standard facility
 /// reliably. Postcondition failure engenders only a warning because
diff --git a/wx_test_document.hpp b/wx_test_document.hpp
index 99c01a6..80f5ea4 100644
--- a/wx_test_document.hpp
+++ b/wx_test_document.hpp
@@ -30,7 +30,7 @@
 #include <wx/testing.h>
 #include <wx/uiaction.h>
 
-#include <exception>
+#include <exception>                    // uncaught_exceptions()
 
 /// Helper function for finding and focusing a control with the specified name
 /// inside MvcController (actually it could be any top level window containing



reply via email to

[Prev in Thread] Current Thread [Next in Thread]