Removed stray .exchange

This commit is contained in:
Herb Sutter 2020-12-18 11:34:25 -08:00
parent a45265a75e
commit 9033021831

View File

@ -18,6 +18,7 @@
#define GSL_CONTRACTS_H #define GSL_CONTRACTS_H
#include <atomic> #include <atomic>
#include <utility>
// //
// Temporary until MSVC STL supports no-exceptions mode. // Temporary until MSVC STL supports no-exceptions mode.
@ -109,7 +110,7 @@ public:
#endif #endif
contract_group (handler h) { set_handler(h); } contract_group (handler h) { set_handler(h); }
auto set_handler(handler h) -> handler { return chandler.exchange(h ? h : []()noexcept{}); } auto set_handler(handler h) -> handler { return std::exchange(chandler, h ? h : []()noexcept{}); }
auto get_handler() -> handler { return chandler; } auto get_handler() -> handler { return chandler; }
void expects (bool b) { assertion(b); } void expects (bool b) { assertion(b); }