Remove constexpr again to see what the failures were

This commit is contained in:
Herb Sutter 2020-12-18 11:25:04 -08:00
parent 1c37688ccd
commit 8bd828744f

View File

@ -112,10 +112,10 @@ public:
auto set_handler(handler h) -> handler { return chandler.exchange(h ? h : []()noexcept{}); } auto set_handler(handler h) -> handler { return chandler.exchange(h ? h : []()noexcept{}); }
auto get_handler() -> handler { return chandler; } auto get_handler() -> handler { return chandler; }
constexpr void expects (bool b) { assertion(b); } void expects (bool b) { assertion(b); }
constexpr void ensures (bool b) { assertion(b); } void ensures (bool b) { assertion(b); }
private: private:
constexpr void assertion(bool b) { if (!b) chandler.load()(); } void assertion(bool b) { if (!b) chandler.load()(); }
#ifdef __cpp_guaranteed_copy_elision #ifdef __cpp_guaranteed_copy_elision
std::atomic<handler> chandler; // current handler std::atomic<handler> chandler; // current handler