diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index e7c3d7405d..54cc7849a8 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -454,6 +454,13 @@ struct IntegerSequence { template using IndexSequence = IntegerSequence; +#if __has_builtin(__make_integer_seq) +template +using MakeIntegerSequence = __make_integer_seq; +#elif __has_builtin(__integer_pack) +template +using MakeIntegerSequence = IntegerSequence; +#else template auto make_integer_sequence_impl() { @@ -465,6 +472,7 @@ auto make_integer_sequence_impl() template using MakeIntegerSequence = decltype(make_integer_sequence_impl()); +#endif template using MakeIndexSequence = MakeIntegerSequence; diff --git a/AK/TypeList.h b/AK/TypeList.h index 2c28da3445..e2f3d13e8f 100644 --- a/AK/TypeList.h +++ b/AK/TypeList.h @@ -16,6 +16,12 @@ struct TypeList; template struct TypeListElement; +#if __has_builtin(__type_pack_element) +template +struct TypeListElement> { + using Type = __type_pack_element; +}; +#else template struct TypeListElement> : TypeListElement> { @@ -25,6 +31,7 @@ template struct TypeListElement<0, TypeList> { using Type = Head; }; +#endif template struct TypeList {