Commit graph

2 commits

Author SHA1 Message Date
Linus Groh a8ac8c6a8f AK: Add missing 'template' keywords in TypeList
This caused the AK build to be broken on OpenBSD (and possibly other
platforms / compiler versions).
Fixes #4692.
2020-12-31 16:16:07 +01:00
Andrew Kaster 3bf77f01a7 AK: Add a TypeList class for expanded compile-time tools
Also add IndexSequence and associated helpers. The TypeList class can be
queried for what type is at a certain index, and there are two helper
functions: for_each_type, and for_each_type_zipped.

for_each_type will invoke a lambda with a TypeWrapper object for
each type in the type list. The original type can be obtained by
extracting the ::Type from the type of your generic lambda's one
argument.

for_each_type_zipped will walk two TypeLists in lockstep and pass a
TypeWrapper object for the current index in each list to a generic
lambda. The original type from the TypeList can again be extracted via
the ::Type of the generic lambda's two parameters.
2020-12-30 11:32:20 +01:00