Intuitive & Powerful C++20 consteval metaprogramming library(via value).

Overview

meta-value-list

This library provides a bunch of consteval toolsets to do metaprogramming, and provides the pipeline syntactic sugar for function combination, its experience is better than traditional template metaprogramming.

All PRs are welcome.

value calculation

constexpr auto res = value_list<1,2,3,4,5,6,7,8,9,10>
                   | transform([](auto x) { return x * x; })
                   | filter([](auto x) { return x < 30; })
                   | fold_left(0, [](auto acc, auto n) { return acc + n; })
                   ;
static_assert(res == 55);

type calculation

constexpr auto result = type_list<int, char, long, char, short, float, double>
                      | filter([]<typename T>(TypeConst<T>) { return sizeof(T) < 4; })
                      | transform([]<typename T>(TypeConst<T>) { return _t<std::add_pointer_t<T>>; })
                      | unique()
                      | convert_to<std::variant>()
                      ;
static_assert(result == _t<std::variant<char*, short*>>);

Tested Compiler

  • gcc-11.2 Worked
  • msvc-19.30.30705 VS17.0 Worked
  • clang-14 Crashed

More motivated examples

examples

Inspiration

You might also like...
πŸ” A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
πŸ” A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.

πŸ” ImHex A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM. Supporting If you like my work, plea

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.

δΈ­ζ–‡η‰ˆζœ¬θ―·ε‚ηœ‹θΏ™ι‡Œ MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Andr

A high performance, shared memory, lock free, cross platform, single file, no dependencies, C++11 key-value store
A high performance, shared memory, lock free, cross platform, single file, no dependencies, C++11 key-value store

SimDB A high performance, shared memory, lock free, cross platform, single file, no dependencies, C++11 key-value store. SimDB is part of LAVA (Live A

Small Extremely Powerful Header Only C++ Lexical Analyzer/String Parser Library
Small Extremely Powerful Header Only C++ Lexical Analyzer/String Parser Library

lexpp Small Extremely Powerful Header Only C++ Lexical Analyzer/String Parser Library Lexpp is made with simplicity and size in mind. The entire libra

A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language.

Fastcode A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language. FastCode is a procedural/str

Powerful automated tool for reverse engineering Unity IL2CPP binaries
Powerful automated tool for reverse engineering Unity IL2CPP binaries

Powerful automated tool for reverse engineering Unity IL2CPP binaries

seg's WONDELFUL, INCREDIBLE and POWERFUL 16-bit CPU (:

seg's WONDELFUL, INCREDIBLE and POWERFUL 16-bit CPU (: Not really ): This is just a tiny emulated ISA and CPU with an assembler, a simple debugg

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.

Karabiner-Elements Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra or later. Download You can download Karabiner-E

A powerful duplicate file finder and an enhanced fork of 'fdupes'.

Introduction jdupes is a program for identifying and taking actions upon duplicate files. A WORD OF WARNING: jdupes IS NOT a drop-in compatible replac

Owner
Netcan
C++ Programmer
Netcan
John Walker 24 Dec 15, 2022
Arbitrary Precision provides C++ long integer types that behave as basic integer types. This library aims to be intuitive and versatile in usage, rather than fast.

Arbitrary Precision (AP) Cross-platform and cross-standard header-only arbitrary precision arithmetic library. Currently it offers integer types that

null 17 Sep 28, 2022
A tiny metaprogramming library

Meta: A tiny metaprogramming library Meta is a tiny and header-only C++11 metaprogramming library released under the Boost Software License. Supported

Eric Niebler 272 Nov 22, 2022
This project contains a library for C++ AST parsing, metaprogramming and reflection

Meta C++ This project contains a library for C++ AST parsing, metaprogramming and reflection. Also included is a tool for generating the necessary met

Keith Hammond 76 Dec 15, 2022
A cleaner and more intuitive std::variant alternative

[WIP] ExtendedVariant This single header library is part of my C++ extended standard stdex libraries. Check our my profile for more. Working with C++

pinsrq 3 Jun 13, 2021
An IoT based project using Wi-Fi Module and MIT App Inventor with intuitive control

Phone Controlled (joystick) Robot Car Project An IoT based project using Wi-Fi Module and MIT App Inventor with intuitive control. A 4 wheeler robot c

Sukritee Sharma 2 Nov 3, 2022
Modern transactional key-value/row storage library.

Sophia is advanced transactional MVCC key-value/row storage library. How does it differ from other storages? Sophia is RAM-Disk hybrid storage. It is

Dmitry Simonenko 1.8k Dec 15, 2022
This repository is for everyone for Hacktoberfest 2021. Anyone can contribute anything for your Swags (T- Shirt), must be relevant that can add some value to this repository.

Hacktober Fest 2021 For Everyone! Upload Projects or Different Types of Programs in any Language Use this project to make your first contribution to a

Mahesh Jain 174 Dec 27, 2022
An AI for playing NES Tetris at a high level. Based primarily on search & heuristic, with high quality board evaluation through value iteration.

StackRabbit An AI that plays NES Tetris at a high level. Primarily based on search & heuristic, with high-quality board eval through value iteration.

Greg Cannon 244 Jan 5, 2023