// SPDX-License-Identifier: BSD-2-Clause // author: Max Kellermann #pragma once #include /** * Compatibility wrapper for std::invocable which is unavailable in * the Android NDK r25b and Apple Xcode. */ #if !defined(ANDROID) && !defined(__APPLE__) template concept Invocable = std::invocable; #else template concept Invocable = requires(F f, Args... args) { { f(args...) }; }; #endif /** * Compatibility wrapper for std::predicate which is unavailable in * the Android NDK r25b and Apple Xcode. */ #if !defined(ANDROID) && !defined(__APPLE__) template concept Predicate = std::predicate; #else template concept Predicate = requires(F f, Args... args) { { f(args...) } -> std::same_as; }; #endif template concept Disposer = Invocable;