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.
boost/openmethod.hpp
✓ #include <boost/openmethod.hpp>
Define and use open methods with virtual dispatch.
#include <boost/openmethod.hpp>
#include <iostream>
struct Animal { virtual ~Animal() = default; };
struct Dog : Animal {};
struct Cat : Animal {};
BOOST_OPENMETHOD(void, speak, (const Animal&), boost::openmethod::virtual_);
BOOST_OPENMETHOD_OVERRIDE(void, speak, (const Dog& d), boost::openmethod::virtual_) {
std::cout << "Woof!\n";
}
BOOST_OPENMETHOD_OVERRIDE(void, speak, (const Cat& c), boost::openmethod::virtual_) {
std::cout << "Meow!\n";
}
int main() {
Dog d; Cat c;
speak(d);
speak(c);
return 0;
}
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.