Registry / other / yomm2
library1.6.0vcpkgunverified

YOMM2 is an implementation of open multi-methods for C++.

vcpkg install yomm2
INSTALL
IMPORT
SIG · YOMM2
Y
yomm2
othercppv1.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

yorel/yomm2.hpp
#include <yorel/yomm2.hpp>

Define and use open multi-methods for animal interactions

#include <yorel/yomm2.hpp> #include <iostream> using yorel::yomm2::virtual_; class Animal { public: virtual ~Animal() = default; }; class Dog : public Animal {}; class Cat : public Animal {}; register_class(Animal); register_class(Dog, Animal); register_class(Cat, Animal); declare_method(void, meet, (virtual_<Animal&>, virtual_<Animal&>)); define_method(void, meet, (Dog& a, Dog& b)) { std::cout << "Woof!\n"; } define_method(void, meet, (Cat& a, Cat& b)) { std::cout << "Meow!\n"; } int main() { yorel::yomm2::update(); Dog d; Cat c; meet(d, d); meet(c, c); return 0; }
Debug
Known issues
gotchaRequires calling yorel::yomm2::update() after registering all classes and methods.
fix
Always call update() before using any method dispatch.
affects: all
Upgrade
Version history
1.6.0latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
Resources

No resource links recorded.

yomm2 — pip install yomm2 · libregistry