Open multi-methods for C++11

Overview

YOMM11 IS DEPRECATED

Thank you for the stars and the feedback!

In 2017 I learned the D language, and I implemented an open method library for D. In the process I had a few fresh ideas, some of which are applicable to C++. Also, my colleague David Goffredo educated me on the power of modern preprocessor macros.

Consequently, I set out to re-implement Yomm11 from scratch. The result is Yomm2, which I feel is a much better library. Read about the improvements here.

I will no longer actively develop Yomm11 but I will consider PRs. I strongly recommend switching to Yomm2 though.

Old content:

This library implements open multi-methods for C++11.

Salient features are:

  • syntax: is relatively uncluttered. There are no limitations on the number of virtual arguments. Virtual and non-virtual arguments can be arbitrarily mixed. Virtual and multiple inheritance are supported.

  • speed: close to a virtual function call when the hierarchies involved in the virtual arguments collaborate with the library. Calling a method that does nothing, with a single virtual argument in a single inheritance hierarchy is 33% slower than the equivalent virtual function call. The difference becomes unnoticeable if the functions perform a few simple maths operations. See tests/benchmarks.cpp.

  • size: dispatch tables are constructed in terms of class groups. This results in a tables devoid of redundancies.

  • support for "foreign" class hierarchies: the library can be used without modifications to existing classes, at the cost of lower performance. Collaborating and foreign arguments can be freely mixed. Performance is still quite good, see the benchmarks.

  • next: a pointer to the next most specialized method is available inside method specializations - see examples/next.cpp. Alternatively, it is possible to call a specialization directly.

Documentation: http://www.yorel.be/mm/ - see also the articles on Code Project http://tinyurl.com/m8kg2y3

Support and discussions: yomm11 on Google Groups (https://groups.google.com/forum/#!forum/yomm11)

Author: Jean-Louis Leroy - [email protected]

You might also like...
A framework to monitor and improve the performance of PostgreSQL using Machine Learning methods.
A framework to monitor and improve the performance of PostgreSQL using Machine Learning methods.

pg_plan_inspector pg_plan_inspector is being developed as a framework to monitor and improve the performance of PostgreSQL using Machine Learning meth

C++ header-only library with methods to efficiently encode/decode Morton codes in/from 2D/3D coordinates

Libmorton v0.2.7 Libmorton is a C++ header-only library with methods to efficiently encode/decode 64, 32 and 16-bit Morton codes and coordinates, in 2

QMoM methods for fluid dynamics in C++, C, and OpenACC.

GPU-QBMMlib QMoM methods for fluid dynamics in C++, C, and OpenACC. Agenda Add more test cases from Marchisio Debug higher-dimensional algorithms Fami

Mobile platform for analysis of localization methods using the Intel RealSense T265 sensor
Mobile platform for analysis of localization methods using the Intel RealSense T265 sensor

OptiBot Mobile platform for analysis of localization methods using the Intel RealSense T265 sensor About | Content | Implementation | License | Author

Fast and Light-weight path smoothing methods for vehicles
Fast and Light-weight path smoothing methods for vehicles

path_smoother About Fast and Light-weight path smoothing methods for vehicles Denpendencies This project has been tested on Ubuntu 18.04. sudo apt-get

OptimLib: a lightweight C++ library of numerical optimization methods for nonlinear functions
OptimLib: a lightweight C++ library of numerical optimization methods for nonlinear functions

OptimLib OptimLib is a lightweight C++ library of numerical optimization methods for nonlinear functions. Features: A C++11 library of local and globa

A gazebo actor plugin that utilizes the map of the environment and graph search methods to generate random actor trajectories that don't pass through walls, furniture, etc.

Gazebo-Map-Actor-Plugin A gazebo actor plugin that utilizes the map of the environment and graph search methods to generate random actor trajectories

Arduino, esp32 and esp8266 library for ABB (ex PowerOne) Aurora Inverter, implement a full methods to retrieve data from the Inverter via RS-485
Arduino, esp32 and esp8266 library for ABB (ex PowerOne) Aurora Inverter, implement a full methods to retrieve data from the Inverter via RS-485

ABB Aurora protocol You can refer the complete documentation on my site ABB Aurora PV inverter library for Arduino, esp8266 and esp32 I create this li

An Arduino library with additions to vanilla Serial.print(). Chainable methods and verbosity levels. Suitable for debug messages.

advancedSerial This library provides some additions to vanilla Serial.print(): 1. Chainable print() and println() methods: // you can chain print() a

Injection - Windows process injection methods

Windows Process Injection Here are some popular methods used for process injection on the windows operating system. Conhost ExtraBytes PROPagate Servi

C++ functions matching the interface and behavior of python string methods with std::string

Pystring is a collection of C++ functions which match the interface and behavior of python's string class methods using std::string. Implemented in C+

A PIC/FLIP fluid simulation based on the methods found in Robert Bridson's
A PIC/FLIP fluid simulation based on the methods found in Robert Bridson's "Fluid Simulation for Computer Graphics"

GridFluidSim3d This program is an implementation of a PIC/FLIP liquid fluid simulation written in C++11 based on methods described in Robert Bridson's

std::tuple like methods for user defined types without any macro or boilerplate code

Boost.PFR This is a C++14 library for very basic reflection that gives you access to structure elements by index and provides other std::tuple like me

A fast multi-producer, multi-consumer lock-free concurrent queue for C++11

moodycamel::ConcurrentQueue An industrial-strength lock-free queue for C++. Note: If all you need is a single-producer, single-consumer queue, I have

Minerva: a fast and flexible tool for deep learning on multi-GPU. It provides ndarray programming interface, just like Numpy. Python bindings and C++ bindings are both available. The resulting code can be run on CPU or GPU. Multi-GPU support is very easy. A bounded multi-producer multi-consumer concurrent queue written in C++11
A bounded multi-producer multi-consumer concurrent queue written in C++11

MPMCQueue.h A bounded multi-producer multi-consumer concurrent queue written in C++11. It's battle hardened and used daily in production: In the Frost

Multi-dimensional dynamically distorted staggered multi-bandpass LV2 plugin
Multi-dimensional dynamically distorted staggered multi-bandpass LV2 plugin

B.Angr A multi-dimensional dynamicly distorted staggered multi-bandpass LV2 plugin, for extreme soundmangling. Based on Airwindows XRegion. Key featur

Multi-Scale Geometric Consistency Guided and Planar Prior Assisted Multi-View Stereo

ACMMP [News] The code for ACMH is released!!! [News] The code for ACMM is released!!! [News] The code for ACMP is released!!! About This repository co

A fast multi-producer, multi-consumer lock-free concurrent queue for C++11

moodycamel::ConcurrentQueue An industrial-strength lock-free queue for C++. Note: If all you need is a single-producer, single-consumer queue, I have

Comments
  • Looking forward for your 4th article in codeproject

    Looking forward for your 4th article in codeproject

    Thank you for your excellent library , I am very interested in multiple dispatch and type erasure. I am reading your code and try to use it with type erasure container, however, the code is difficult, so i hope the 4th and final article can help me .

    Again, Thank you for your library and effort!

    opened by EruditePig 1
  • extern_macros

    extern_macros

    extern_macros.hpp still uses constexpr. I think this won't work with MSVC13. It would be an easy fix, but extern_macros.hpp doesn't work with Linux. I don't know how big the compile-time improvement is here. Is it worth fixing?

    opened by zauguin 1
  • Feature detect constexpr and added constructor

    Feature detect constexpr and added constructor

    The default constructor is required because of the C++ standard, section 8.5:

    If a program calls for the default initialization of an object of a const-qualified type T, T shall be a class type with a user-provided default constructor.
    
    opened by zauguin 0
Releases(1.03)
Owner
Jean-Louis Leroy
Jean-Louis Leroy
An open source, OOP language with editable syntax.

Copper An Open source compiled programming language, In development. Goals Copper is an general-purpose OOP language. Coppers main goal is to allow ea

null 12 Jul 22, 2022
Open multi-methods for C++11

YOMM11 IS DEPRECATED Thank you for the stars and the feedback! In 2017 I learned the D language, and I implemented an open method library for D. In th

Jean-Louis Leroy 116 May 12, 2022
Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform AAA Open 3D Engine

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.

O3DE 5.3k Sep 22, 2022
std::tuple like methods for user defined types without any macro or boilerplate code

Boost.PFR This is a C++14 library for very basic reflection that gives you access to structure elements by index and provides other std::tuple like me

Antony Polukhin 133 Sep 17, 2022
Modding (hacking) il2cpp games by classes, methods, fields names.

ByNameModding Modding (hacking) il2cpp games by classes, methods, fields names. Status: Ready to use Why did I do it 1. In order not to update the off

null 85 Sep 18, 2022
Class containing Anti-RE, Anti-Debug and Anti-Hook methods. Made for C++/CLI

Umium Class containing Anti-RE, Anti-Debug and Anti-Hook methods. Easy to use and easy to implement. Disclaimer This code has been made and optimized

null 42 Sep 10, 2022
A library of type safe sets over fixed size collections of types or values, including methods for accessing, modifying, visiting and iterating over those.

cpp_enum_set A library of type safe sets over fixed size collections of types or values, including methods for accessing, modifying, visiting and iter

Carl Dehlin 22 Jun 16, 2022
(R) Efficient methods and operators for the sparse matrix classes in 'Matrix' (esp. CSR format or "RsparseMatrix")

MatrixExtra MatrixExtra is an R package which extends the sparse matrix and sparse vector types in the Matrix package, particularly the CSR or Rsparse

null 15 Aug 29, 2022
numerical optimizaiton methods with msnhnet

Numerical Optimization with Msnhnet. Algorithms: Unconstrained Methods Steepest Descent Newton Damped Newton Newton Levenberg Marquardt Quasi Newton (

msnh2012 11 May 22, 2022
A C++17 library of computationally efficient methods for calculating sample statistics

Vectorized statistics using SIMD primitives Introduction is a C++17 library of computationally efficient methods for calculating sample statistics (me

HEAL 10 Jan 7, 2022