Skip to content

Instantly share code, notes, and snippets.

View nicuveo's full-sized avatar
🏳️‍⚧️

Antoine Leblanc nicuveo

🏳️‍⚧️
View GitHub Profile
@nicuveo
nicuveo / 00_README.md
Last active August 29, 2015 14:16
Extending library visitor for user-defined types with macros

Summary

The code in this gist tries to find a way to have pseudo "multi methods" in C++ by extending a visitor interface, hence the title: extending library visitor for user-defined types with macros. The idea is this: you want to implement the Visitor pattern over a class hierarchy defined in a library. But users of the library might have their own classes, extending the hierarchy, forcing your visitor to know about them. My proposal: a small macros that extend the visitor