From b98d8ad5b01c41efff24faffe94918435194257a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 8 Mar 2020 10:36:11 +0100 Subject: [PATCH] AK: Add a Conditional template This allows you to select a type based on a compile-time condition. --- AK/StdLibExtras.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index ff80340bd1a..7dea07a6e11 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -320,8 +320,19 @@ struct IsSame { }; }; +template +struct Conditional { + typedef TrueType Type; +}; + +template +struct Conditional { + typedef FalseType Type; +}; + } +using AK::Conditional; using AK::ceil_div; using AK::clamp; using AK::exchange;