/* * Copyright (c) 2020, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace AK::Concepts { template concept Integral = IsIntegral; template concept FloatingPoint = IsFloatingPoint; template concept Arithmetic = IsArithmetic; template concept Signed = IsSigned; template concept Unsigned = IsUnsigned; template concept Enum = IsEnum; template concept SameAs = IsSame; // FIXME: remove once Clang formats these properly. // clang-format off template concept VoidFunction = requires(Func func, Args... args) { { func(args...) } -> SameAs; }; template concept IteratorFunction = requires(Func func, Args... args) { { func(args...) } -> SameAs; }; // clang-format on } using AK::Concepts::Arithmetic; using AK::Concepts::Enum; using AK::Concepts::FloatingPoint; using AK::Concepts::Integral; using AK::Concepts::IteratorFunction; using AK::Concepts::Signed; using AK::Concepts::Unsigned; using AK::Concepts::VoidFunction;