summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AK/Concepts.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/AK/Concepts.h b/AK/Concepts.h
index 7186d6c2ef..f54028929a 100644
--- a/AK/Concepts.h
+++ b/AK/Concepts.h
@@ -111,12 +111,20 @@ concept IterableContainer = requires
{ declval<T>().begin() } -> IteratorPairWith<decltype(declval<T>().end())>;
};
+template<typename Func, typename... Args>
+concept FallibleFunction = requires(Func&& func, Args&&... args) {
+ func(forward<Args>(args)...).is_error();
+ func(forward<Args>(args)...).release_error();
+ func(forward<Args>(args)...).release_value();
+};
+
// clang-format on
}
using AK::Concepts::Arithmetic;
using AK::Concepts::ArrayLike;
using AK::Concepts::Enum;
+using AK::Concepts::FallibleFunction;
using AK::Concepts::FloatingPoint;
using AK::Concepts::Fundamental;
using AK::Concepts::Integral;