mirror of
https://github.com/microsoft/GSL.git
synced 2025-01-18 09:44:59 -05:00
Added "vestigial" comments for downlevel feature test workarounds
This commit is contained in:
parent
070db845f8
commit
c78ad8661c
@ -105,19 +105,19 @@ class contract_group {
|
||||
public:
|
||||
#ifdef __cpp_noexcept_function_type
|
||||
using handler = void (*)() noexcept;
|
||||
#else
|
||||
#else // VESTIGIAL, remove when no longer needed for downlevel compilers
|
||||
using handler = void (*)();
|
||||
#endif
|
||||
|
||||
#if defined(__cpp_constexpr) && __cpp_constexpr >= 201806
|
||||
constexpr contract_group (handler h) { set_handler(h); }
|
||||
#else
|
||||
#else // VESTIGIAL, remove when no longer needed for downlevel compilers
|
||||
constexpr contract_group (handler h) : chandler(h ? h : []()noexcept{}) { }
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 202002L
|
||||
constexpr auto set_handler(handler h) -> handler { return std::exchange(chandler, h ? h : []()noexcept{}); }
|
||||
#else
|
||||
#else // VESTIGIAL, remove when no longer needed for downlevel compilers
|
||||
constexpr auto set_handler(handler h) -> handler { auto old = chandler;
|
||||
chandler = h ? h : []()noexcept{};
|
||||
return old;
|
||||
|
Loading…
Reference in New Issue
Block a user