Handler shouldn't be internally synchronized

This commit is contained in:
Herb Sutter 2020-12-18 11:30:17 -08:00
parent 8bd828744f
commit a45265a75e

View File

@ -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<handler> chandler; // current handler
#else
void assertion(bool b) { if (!b) chandler(); }
handler chandler;
#endif
};
auto static Default = contract_group( &gsl::details::terminate );