Universal C++ template library
  • C++ 97.9%
  • C 2.1%
Find a file
2026-09-12 01:14:45 +10:00
include feat(concepts): idea of "assignables" model introduced through concepts 2026-09-12 01:14:45 +10:00
.gitignore feat: Gram-specific settings ignored in project 2026-08-11 17:57:32 +10:00
LICENCE.md feat: licence file correctly marked down 2026-05-06 00:10:44 +10:00
README.md feat: new "filter" TFI group takes a lambda predicate and conditionally packs the variadic parameters into a provided template 2026-08-19 16:19:59 +10:00
uncrustify-cfg chore(format): colons in enum declaration are forced to have space 2026-05-19 09:25:39 +10:00

ZPAUK

This is a header-only, C++, template library that aims to have a universal solution for several common problems when using other templates. It has a number of features that exist to compliment or replace those that exist in the C++ STL.

Name

There is no reason for the specific name choice. 'Zpauk' meets the goal of being both pronounceable and lexically unique with only case-insensitive, ASCII characters. It can be pronounced however seems correct to the pronouncer.

Template form identifier system

The template form identifier (TFI) is a short string of characters that identifies the form of a template and is used typically to identify the templates of template parameters.

C++26 does not have the capability to generically deduce nor generate these templates. Syntax like template [[typename, 1], [auto, 1]] typename meaning template <typename, auto> typename, where 1 could be substituted for any number to have that many repeats of a template parameter placeholder, may be supported in future but the utility of such is limited enough at present that it is not believed work will ever begin on such a system.

For this reason, this codebase contains a number of templates (for type aliases, structs, functions, etc.) that contain 0t and 0n or similar in their names. These are the identifiers of the the TFI system. Each block is made up of three parts.

  1. Count - an integer. '0' means that it represents variadic parameters and can only appear as the final block.
  2. Kind - 't', 'n', or 'd'; these are respectively 'type', 'non-type', and 'dependent non-type'. These would be identified within a C++ template declaration as typename T_, auto N_, and T_ D_.
  3. Metadata (optional) - presently only used for 'd', indicates the corresponding parameter index of the 't' that it is typed after.

Groups of type templates that have multiple declarations with names and templates corresponding to the TFI system are referred to as "template-form-identified groups" and presently include repack, unpack, conditional, reverse, and filter. packed_traits uses the system to attempt to identify from a single packed type what template form it is made from and stores that in an enum of recognised TFIs.

Examples

  • 1t becomes <typename>.
  • 1n becomes <auto>.
  • 0t becomes <typename...>.
  • 3n_1t_2d3_0t becomes <auto, auto, auto, typename T_, T_, T_, typename...>.

Credits

  • Primary codebase developer, MnPX
  • C++ STL design, Alexander Stepanov