Lightweight, header-only C++14 metaprogramming library. Pattern matching, compile-time stuffs and algorithms (arrays, type information (CTTI), string manipulation), 'value-or-errorcode' union-like type, type for passing named arguments, useful constexpr functions and many more. (MIT license)

Overview

CoMeta

Build Status

Lightweight, header-only C++14 metaprogramming library. Created for KFR framework.

Features

  • Pattern matching
  • Compile-time arrays
  • Compile-time type information (CTTI)
  • Compile-time string manipulation
  • Compile-time operations on arrays and numbers
  • 'value-or-errorcode' union-like type
  • type for passing named arguments
  • function wrapper (lightweight replacement for std::function)
  • Useful constexpr functions and many more.

Platform

CoMeta is platform-independent but modern C++14 compiler is required.

  • AppleClang (XCode 7, 8)
  • Clang 3.7 or newer
  • GCC 5.1 or newer

Tests

See tests/cometa_test.cpp

License

MIT

See LICENSE for details

You might also like...
Functional programming style pattern-matching library for C++
Functional programming style pattern-matching library for C++

Mach7: Pattern Matching for C++ by Yuriy Solodkyy, Gabriel Dos Reis, Bjarne Stroustrup Abstract Pattern matching is an abstraction mechanism that can

Half-Life Singleplayer SDK 2.3, updated to compile with Visual Studio 2019. Provided as-is with no further support. See the README for more information.

Half Life 1 SDK LICENSE Half Life 1 SDK Copyright© Valve Corp. THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE CORPORATION (“Valve”). PLEASE

Cricket Stuffs (C++).

Cricket Stuffs Description A simple program to calculate some cool informations of cricket. Can do calculate the following stuffs: Run Rate Current Ru

DimensionalAnalysis - A compact C++ header-only library providing compile-time dimensional analysis and unit awareness

Dimwits ...or DIMensional analysis With unITS is a C++14 library for compile-time dimensional analysis and unit awareness. Minimal Example #include i

A commented version of my libft, with details about how my algorithms work and simple main functions to compile them.
A commented version of my libft, with details about how my algorithms work and simple main functions to compile them.

LIBFT COMMENTED VERSION : 🔧 PART I : 📖 FT_STRCHR : 🔧 PART II : 📖 FT_SUBSTR : /* * DEFINITION : * CREATES A SUBSTRING FROM A STRING WITH PREDETER

📚 single header utf8 string functions for C and C++

📚 utf8.h A simple one header solution to supporting utf8 strings in C and C++. Functions provided from the C header string.h but with a utf8* prefix

ServiceLocator - Service Locator Pattern Header-Only Library

Service Locator Very fast, header-only C++ Service Locator Pattern library What is the Service Locator Pattern The Service Locator Pattern is a design

C Program to input a string and adjust memory allocation according to the length of the string.

C-String C Program to input a string and adjust memory allocation according to the length of the string. With the help of this program, we have replic

Comments
  • Cometa bug, sending VCPkgSrv to the moon (and back)

    Cometa bug, sending VCPkgSrv to the moon (and back)

    The following describes the problem as reported to MS and their answer.

    I want to follow-up on the feedback you have submitted, as you described: "The Package Server seems to go into an infinite loop on inclusion of the cometa.hpp of this library: https://github.com/kfrlib/cometa. The library is pretty good, particularly the cometa::function, which reduces the footprint of std::function<> from 64 bytes to (cometa::function<>) 8 bytes (on _WIN64), and does the same. Seems like a candidate to include in the MS-STL. Please forward to Steven T.L.!"

    I have investigated the issue with VCPkgSrv you have described when using the library. It turns out the library is making wrong assumptions on the compiler implementation defined behavior, resulting in extremely deep template instantiation chain. Factually, the compiler is not in an infinite loop, but rather performing the work that it has been requested to do (that is, until it runs out of other resources like memory).

    Going into specifics, IntelliSense compiler is using a different implementation (EDG) than the batch compiler in Visual Studio. They return different values for the FUNCSIG macro. CoMeta library contains function “ctype_name” intending to perform a compile-time substring operation on the result of that macro. The implementation is subtracting a length of the “known” hard-coded prefix of the FUNCSIG result without checking for unsigned integer overflow. In case of IntelliSense compiler the hard-coded prefix is longer than the actual prefix, resulting in integer wrap-around and a very large value passed subsequently to “csizeseq” instantiation, which in turn is performing recursive instantiations based on that value.

    The problem should be corrected in the library source code.

    Best regards, Łukasz Mendakiewicz

    opened by degski 2
  • Returning reference from cometa::function results in compile error on Windows/Clang/LLVM.

    Returning reference from cometa::function results in compile error on Windows/Clang/LLVM.

    When returning a reference type from cometa::function<something & (some parameters...)> on Windows VC14/Update3 with Clang/LLVM (http://llvm.org/builds/) a compiler error is raised. Returning a pointer cometa::function<something * (some parameters...)> works fine, and is obviously a work-around, but it would be nice to have a reference returned.

    edited: clarify what I intended to say.

    opened by degski 2
Simple header only pattern matching for c++14

Simple, Extensible C++ Pattern Matching Library I have recently been looking at Haskell and Rust. One of the things I wanted in C++ from those languag

John Bandela 210 Dec 30, 2022
Pipet - c++ library for building lightweight processing pipeline at compile-time for string obfuscation, aes ciphering or whatever you want

Pipet Pipet is a lightweight c++17 headers-only library than can be used to build simple processing pipelines at compile time. Features Compile-time p

C. G. 60 Dec 12, 2022
Intuitive & Powerful C++20 consteval metaprogramming library(via value).

meta-value-list This library provides a bunch of consteval toolsets to do metaprogramming, and provides the pipeline syntactic sugar for function comb

Netcan 35 Oct 21, 2022
Intuitive & Powerful C++20 consteval metaprogramming library(via value).

meta-list This library provides a bunch of consteval toolsets to do metaprogramming, and provides the pipeline syntactic sugar for function combinatio

Netcan 35 Oct 21, 2022
Wortuhr mit ESP8266 WeMos D1 mini und NeoPixel WS2812B LEDs mit mp3 Sounds, Animationen, Transitions, Events und Spiele

Wortuhr_ESP8266 Wortuhr mit ESP8266 WeMos D1 mini und NeoPixel WS2812B LEDs mit mp3 Sounds, Animationen, Transitions, Events und Spiele, Webzugriff So

null 25 Dec 22, 2022
Rangeless - c++ LINQ -like library of higher-order functions for data manipulation

rangeless::fn range-free LINQ-like library of higher-order functions for manipulation of containers and lazy input-sequences. Documentation What it's

null 184 Dec 27, 2022
Manual mapper that uses PTE manipulation, Virtual Address Descriptor (VAD) manipulation, and forceful memory allocation to hide executable pages. (VAD hide / NX bit swapping)

Stealthy Kernel-mode Injector Manual mapper that uses PTE manipulation, Virtual Address Descriptor (VAD) manipulation, and forceful memory allocation

Charlie Wolfe 137 Jan 3, 2023
Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Paulo Rafael Ramalho 0 Jan 1, 2023
Einsums in C++ Provides compile-time contraction pattern analysis to determine optimal operation to perform

Einsums in C++ Provides compile-time contraction pattern analysis to determine optimal operation to perform. Examples This will optimize at compile-ti

Justin Turney 14 Dec 15, 2022