From 7a5b1c1a19a2aca0462cbd9adb4efed4100e5a15 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 25 Jul 2024 18:03:41 +0000 Subject: [PATCH] Try Catch convenience macro --- Grid/Namespace.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Grid/Namespace.h b/Grid/Namespace.h index 29b229fa..c42b46b3 100644 --- a/Grid/Namespace.h +++ b/Grid/Namespace.h @@ -30,9 +30,14 @@ directory #include #include +#include #define NAMESPACE_BEGIN(A) namespace A { #define NAMESPACE_END(A) } #define GRID_NAMESPACE_BEGIN NAMESPACE_BEGIN(Grid) #define GRID_NAMESPACE_END NAMESPACE_END(Grid) #define NAMESPACE_CHECK(x) struct namespaceTEST##x {}; static_assert(std::is_same::value,"Not in :: at" ); + +#define EXCEPTION_CHECK_BEGIN(A) try { +#define EXCEPTION_CHECK_END(A) } catch ( std::exception e ) { BACKTRACEFP(stderr); std::cerr << __PRETTY_FUNCTION__ << " : " <<__LINE__<< " Caught exception "<