From a45265a75e858b86189a5a3e65abdd0637ee7c18 Mon Sep 17 00:00:00 2001 From: Herb Sutter Date: Fri, 18 Dec 2020 11:30:17 -0800 Subject: [PATCH] Handler shouldn't be internally synchronized --- include/gsl/assert | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/gsl/assert b/include/gsl/assert index f1fd7bc..2fb56ee 100644 --- a/include/gsl/assert +++ b/include/gsl/assert @@ -115,13 +115,8 @@ public: void expects (bool b) { assertion(b); } void ensures (bool b) { assertion(b); } private: - void assertion(bool b) { if (!b) chandler.load()(); } - -#ifdef __cpp_guaranteed_copy_elision - std::atomic chandler; // current handler -#else + void assertion(bool b) { if (!b) chandler(); } handler chandler; -#endif }; auto static Default = contract_group( &gsl::details::terminate );