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

Overview

meta-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 _v<x * x>; })
                   | filter([](auto x) { return _v<x < 30>; })
                   | fold_left(_v<0>, [](auto acc, auto n) { return _v<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 _v<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

Owner
Netcan
C++ Programmer
Netcan
John Walker 18 Aug 8, 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 266 Jul 27, 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 16 Aug 3, 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 75 Jun 26, 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 1 Jan 20, 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 Aug 8, 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 16 Dec 21, 2021
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 213 Aug 6, 2022
πŸ” 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

WerWolv 19.9k Aug 10, 2022
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

Tencent 14.9k Aug 11, 2022
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

null 442 Jun 25, 2022
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

Jaysmito Mukherjee 49 Jun 21, 2022
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

null 27 May 31, 2022
Powerful automated tool for reverse engineering Unity IL2CPP binaries

Powerful automated tool for reverse engineering Unity IL2CPP binaries

Katy 1.9k Aug 5, 2022
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

null 18 Nov 8, 2021
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

null 15.1k Aug 12, 2022
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

Jody Bruchon 1.2k Aug 1, 2022