mirror of
https://github.com/microsoft/GSL.git
synced 2025-01-18 17:55:01 -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:
|
public:
|
||||||
#ifdef __cpp_noexcept_function_type
|
#ifdef __cpp_noexcept_function_type
|
||||||
using handler = void (*)() noexcept;
|
using handler = void (*)() noexcept;
|
||||||
#else
|
#else // VESTIGIAL, remove when no longer needed for downlevel compilers
|
||||||
using handler = void (*)();
|
using handler = void (*)();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cpp_constexpr) && __cpp_constexpr >= 201806
|
#if defined(__cpp_constexpr) && __cpp_constexpr >= 201806
|
||||||
constexpr contract_group (handler h) { set_handler(h); }
|
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{}) { }
|
constexpr contract_group (handler h) : chandler(h ? h : []()noexcept{}) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __cplusplus >= 202002L
|
#if __cplusplus >= 202002L
|
||||||
constexpr auto set_handler(handler h) -> handler { return std::exchange(chandler, h ? h : []()noexcept{}); }
|
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;
|
constexpr auto set_handler(handler h) -> handler { auto old = chandler;
|
||||||
chandler = h ? h : []()noexcept{};
|
chandler = h ? h : []()noexcept{};
|
||||||
return old;
|
return old;
|
||||||
|
Loading…
Reference in New Issue
Block a user