diff --git a/src/util/Concepts.hxx b/src/util/Concepts.hxx index 6439dd92a..a741d6900 100644 --- a/src/util/Concepts.hxx +++ b/src/util/Concepts.hxx @@ -5,33 +5,5 @@ #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; +concept Disposer = std::invocable; diff --git a/src/util/IntrusiveHashSet.hxx b/src/util/IntrusiveHashSet.hxx index 01b86329e..fb949d642 100644 --- a/src/util/IntrusiveHashSet.hxx +++ b/src/util/IntrusiveHashSet.hxx @@ -182,7 +182,7 @@ public: counter.reset(); } - void remove_and_dispose_if(Predicate auto pred, + void remove_and_dispose_if(std::predicate auto pred, Disposer auto disposer) noexcept { for (auto &bucket : table) counter -= bucket.remove_and_dispose_if(pred, disposer); @@ -200,7 +200,7 @@ public: } constexpr void remove_and_dispose_if(const auto &key, - Predicate auto pred, + std::predicate auto pred, Disposer auto disposer) noexcept { auto &bucket = GetBucket(key); counter -= bucket.remove_and_dispose_if([this, &key, &pred](const auto &item){ @@ -296,7 +296,7 @@ public: */ [[nodiscard]] [[gnu::pure]] constexpr bucket_iterator find_if(const auto &key, - Predicate auto pred) noexcept { + std::predicate auto pred) noexcept { auto &bucket = GetBucket(key); for (auto &i : bucket) if (equal(key, i) && pred(i)) @@ -320,9 +320,9 @@ public: */ [[nodiscard]] [[gnu::pure]] constexpr bucket_iterator expire_find_if(const auto &key, - Predicate auto expired_pred, + std::predicate auto expired_pred, Disposer auto disposer, - Predicate auto match_pred) noexcept { + std::predicate auto match_pred) noexcept { auto &bucket = GetBucket(key); for (auto i = bucket.begin(), e = bucket.end(); i != e;) { diff --git a/src/util/IntrusiveList.hxx b/src/util/IntrusiveList.hxx index c785fad68..27e5975d9 100644 --- a/src/util/IntrusiveList.hxx +++ b/src/util/IntrusiveList.hxx @@ -271,7 +271,7 @@ public: /** * @return the number of removed items */ - std::size_t remove_and_dispose_if(Predicate auto pred, + std::size_t remove_and_dispose_if(std::predicate auto pred, Disposer auto dispose) noexcept { std::size_t result = 0; diff --git a/src/util/SortList.hxx b/src/util/SortList.hxx index 6856872ba..54a437450 100644 --- a/src/util/SortList.hxx +++ b/src/util/SortList.hxx @@ -3,10 +3,10 @@ #pragma once -#include "Concepts.hxx" #include "StaticVector.hxx" #include // for std::find_if() +#include /** * Move all items from #src to #dest, keeping both sorted. @@ -17,7 +17,7 @@ template constexpr void MergeList(List &dest, List &src, - Predicate auto p) noexcept + std::predicate auto p) noexcept { const auto dest_end = dest.end(), src_end = src.end(); @@ -59,7 +59,7 @@ MergeList(List &dest, List &src, template constexpr void SortList(List &list, - Predicate auto p) noexcept + std::predicate auto p) noexcept { using std::swap;