Boost
Libraries
arrow_drop_down
Boost.OpenMethod
M
D
C++ 17 Added in Boost 1.90.0
Categories:   ProgrammingEmulation

Open-methods are virtual functions that exist outside of classes, as free-standing functions. They make it possible to add polymorphic behavior to existing classes, without modifying them. This implementation supports single and multiple dispatch.

This Release

Jean-Louis Leroy
Maintainer

Dependencies

Library dependencies will be generated soon, please check back later.

Boost.OpenMethod

This page gives a 10,000-foot view of the library. For the motivation, tutorials and reference, please follow the documentation link.

Features

  • Free-standing virtual functions, similar to CLOS, Clojure, Julia, Dylan, etc.

  • Single dispatch can be as fast as equivalent virtual function calls.

  • Multiple dispatch in constant time (for a given number of virtual parameters).

  • Redundancy-free multiple dispatch tables.

  • Inter-operation with standard smart pointers, extensible to other pointer-like types.

  • Exception agnostic by default.

  • Macro-based interface for convenience.

  • Macro-free interface for inter-operation with templates.

  • Customization points for alternative RTTI systems, error handling, vptr placement, etc.

  • Header-only.

Requirements

The library requires an optimizing compiler supporting C++17 or above.

Tested Compilers

Boost.OpenMethod is tested with the following compilers:

  • clang: 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20

  • gcc: 8, 9, 10, 11, 12, 13, 14, 15

  • msvc: 14.3

  • icpx

…​on the following platforms:

  • Linux

  • macOS

  • Windows

  • s390x

Quality Assurance

The development infrastructure for the library includes these per-commit analyses:

  • Coverage reports

  • Clang sanitizers

  • Compilation and tests on Drone.io and GitHub Actions

Build Status

Branch GH Actions Coverity Scan codecov.io Deps Docs

master

CI

Coverity Scan Build Status

codecov

Deps

Documentation

develop

CI

Coverity Scan Build Status

codecov

Deps

Documentation

Community

Questions, suggestions, defect reports, etc can be submitted via the following channels:

  • Slack. Best for quick questions, especially for those getting started with the library.

  • The Boost developers mailing list. Best for in-depth discussion of the features, future, and implementation of the library. Be sure to read the discussion policy before posting. Please add the [openmethod] tag at the beginning of the subject line.

  • Issues page on GitHub. Best for bug reports. Please mention the Boost version, platform and compiler you are using, and provide a small compilable code sample to reproduce the problem. Also a good place for feature requests and suggestions.

License

Distributed under the Boost Software License, Version 1.0.