doublecpp
« Back to VersTracker
Description:
Double dispatch in C++
Type: Formula  |  Latest Version: 0.6.3@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: c++ library polymorphism templates double-dispatch
Install: brew install doublecpp
About:
Doublecpp is a C++ library that implements the Double Dispatch pattern using a type-safe, template-based mechanism. It solves the classic problem of dynamic polymorphism where the correct function overload needs to be selected at runtime based on the types of two objects. This enables cleaner code by avoiding bulky visitor implementations or type-checking switch statements.
Key Features:
  • Implements type-safe double dispatch via templates
  • Simplifies polymorphic interactions between two objects
  • Header-only library for easy integration
  • Avoids RTTI and dynamic_cast overhead
Use Cases:
  • Resolving polymorphic function calls based on two runtime types
  • Implementing collision detection in game engines
  • Designing extensible visitor patterns without complex inheritance
Alternatives:
  • Boost.Variant / Boost.Visitor – Boost provides static visitor capabilities for variant types, whereas doublecpp works with standard class hierarchies.
  • Manual dynamic_cast chains – Doublecpp offers a template-based, type-safe alternative to cascading if-else checks using dynamic_cast.
License: GPL-2.0-or-later
Bottles available for: arm64_tahoe, arm64_sequoia, arm64_sonoma, arm64_ventura, arm64_monterey, arm64_big_sur, sonoma, ventura, monterey, big_sur, catalina, arm64_linux, x86_64_linux
Version History
Detected Version Rev Change Commit