Typelist

EXOTIC.lyst

Build License C++ Version Release

EXOTIC.lyst is a high-performance, header-only C++ library for managing and manipulating typelists. Part of the EXOTIC collection of modern C++ libraries, it provides a full suite of compile-time type operations optimized for template metaprogramming (TMP).


Table of Contents


Features


Installation

Simply include the header in your project:

#include "EXOTIC.lyst.h"

No compilation or linking steps are required, as this is a header-only library.


Usage

Typelist Basics

A typelist is a compile-time list of types:

using MyTypes = EXOTIC::Lyst::typelist<int, float, double>;

Check if a typelist is empty:

static_assert(!EXOTIC::Lyst::empty_v<MyTypes>, "Typelist should not be empty");

Access elements:

using FirstType  = EXOTIC::Lyst::front_t<MyTypes>;  // int
using LastType   = EXOTIC::Lyst::back_t<MyTypes>;   // double
using SecondType = EXOTIC::Lyst::at_t<1, MyTypes>;  // float

Operations

Modify typelists at compile time:

// Push and pop types
using Extended = EXOTIC::Lyst::push_back_t<char, MyTypes>; // int, float, double, char
using Shorter  = EXOTIC::Lyst::pop_front_t<Extended>;      // float, double, char

// Replace a type
using Replaced = EXOTIC::Lyst::replace_t<1, long, MyTypes>; // int, long, double

// Filter types based on a predicate
template<typename T>
struct is_integral_type : EXOTIC::Utility::is_same<T, int>::type {};

using Filtered = EXOTIC::Lyst::filter_t<is_integral_type, MyTypes>; // int

// Transform types
template<typename T>
struct add_pointer { using type = T*; };

using PointerTypes = EXOTIC::Lyst::transform_t<add_pointer, MyTypes>; // int*, float*, double*

Other available operations:


Type Utilities

EXOTIC::Utility provides TMP and type trait helpers:

These utilities enable safer, more readable TMP code.


License

This library is licensed under the Boost Software License, Version 1.0. See LICENSE for details.


Author

Félix-Olivier Dumas GitHub: unrays/Lyst Version: 1.0.0 Last Updated: January 15, 2026

I had zero experience with typelists before this. I built Lyst in 5 intense days and am proud of the work.