
On Sun, Apr 27, 2025 at 9:15 PM Дмитрий Архипов via Boost < boost@lists.boost.org> wrote:
Dear Boost community. The peer review of the proposed Boost.OpenMethod will start on 28th of April and continue until May 7th. OpenMethods implements open methods in C++. Those are "virtual functions" defined outside of classes. They allow avoiding god classes, and visitors and provide a solution to the Expression Problem, and the banana-gorilla-jungle problem. They also support multiple dispatch. This library implements most of Stroustrup's multimethods proposal, with some new features, like customization points and inter-operability with smart pointers. And despite all that open-method calls are fast - on par with native virtual functions.
You can find the source code of the library at https://github.com/jll63/Boost.OpenMethod/tree/master and read the documentation at https://jll63.github.io/Boost.OpenMethod/. The library is header-only and thus it is fairly easy to try it out. In addition, Christian Mazakas (of the C++ Alliance) has added the candidate library to his vcpkg repository (https://github.com/cmazakas/vcpkg-registry-test). The library is also available in Compiler Explorer under the name YOMM2.
I got a few questions for the author: 1. How does a registrar work? 2. What kind of hashing are we doing? 3. "When an error is encountered, the program is terminated by a call to abort" what errors are there? Just pure virtual? 4. Why do we need multiple policies and facets in a single project? Why couldn't we use a single one (at least for policies) project-wide? 5. Do you have any real-world use-cases? I looked at the ast.cpp example, but was a bit disappointed that it was a single argument method. Thanks, Klemens