FUNCTIONAL METAPROGRAMMING WITH LAMBDA META-EXPRESSIONS IN MODERN C++

This paper continues the authors’ earlier work on lambda meta-expressions. These are C++20 lambdas whose call operator is a template over types, so that they act as metafunctions. Template metaprogramming in C++ has a strong relationship with functional programming, but for a long time this relationship was not reflected in the language itself. Lambda meta-expressions bring it into the language: they are written directly in C++, without auxiliary class templates, libraries or translators. We show how lambda meta-expressions filter type lists and form linear type pipelines through a composition combinator. Each step of a pipeline should return the tag std::type_identity<X> rather than a value of type X, and we explain why. We then introduce composition of meta-expressions with one another. With static_assert, we verify that the identity and associativity laws of a category hold for this composition. All examples compile with GCC, Clang and MSVC. Finally, we relate the approach to earlier work by Porkoláb, Sinkovics and Šefl. Its novelty lies not in first-class metafunctions as such, but in obtaining them from a language construct.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-22
DOI
https://doi.org/10.5281/zenodo.24444506
Primary Topic
Logic, programming, and type systems
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

FUNCTIONAL METAPROGRAMMING WITH LAMBDA META-EXPRESSIONS IN MODERN C++

Volodymyr Boublik, Ruslan Zymovets
Zenodo (CERN European Organization for Nuclear Research)
Logic, programming, and type systems
preprint

FUNCTIONAL METAPROGRAMMING WITH LAMBDA META-EXPRESSIONS IN MODERN C++

Volodymyr Boublik, Ruslan Zymovets
preprint en

Abstract

This paper continues the authors’ earlier work on lambda meta-expressions. These are C++20 lambdas whose call operator is a template over types, so that they act as metafunctions. Template metaprogramming in C++ has a strong relationship with functional programming, but for a long time this relationship was not reflected in the language itself. Lambda meta-expressions bring it into the language: they are written directly in C++, without auxiliary class templates, libraries or translators. We show how lambda meta-expressions filter type lists and form linear type pipelines through a composition combinator. Each step of a pipeline should return the tag std::type_identity<X> rather than a value of type X, and we explain why. We then introduce composition of meta-expressions with one another. With static_assert, we verify that the identity and associativity laws of a category hold for this composition. All examples compile with GCC, Clang and MSVC. Finally, we relate the approach to earlier work by Porkoláb, Sinkovics and Šefl. Its novelty lies not in first-class metafunctions as such, but in obtaining them from a language construct.

Zenodo (CERN European Organization for Nuclear Research)
National University (PH), National University (US)
Logic, programming, and type systems
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
FUNCTIONAL METAPROGRAMMING WITH LAMBDA META-EXPRESSIONS IN MODERN C++ — Volodymyr Boublik, Ruslan Zymovets · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS