mirror of
https://github.com/microsoft/GSL.git
synced 2025-03-21 13:04:19 -04:00
Handler shouldn't be internally synchronized
This commit is contained in:
parent
8bd828744f
commit
a45265a75e
@ -115,13 +115,8 @@ public:
|
|||||||
void expects (bool b) { assertion(b); }
|
void expects (bool b) { assertion(b); }
|
||||||
void ensures (bool b) { assertion(b); }
|
void ensures (bool b) { assertion(b); }
|
||||||
private:
|
private:
|
||||||
void assertion(bool b) { if (!b) chandler.load()(); }
|
void assertion(bool b) { if (!b) chandler(); }
|
||||||
|
|
||||||
#ifdef __cpp_guaranteed_copy_elision
|
|
||||||
std::atomic<handler> chandler; // current handler
|
|
||||||
#else
|
|
||||||
handler chandler;
|
handler chandler;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
auto static Default = contract_group( &gsl::details::terminate );
|
auto static Default = contract_group( &gsl::details::terminate );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user