Skip to content

v0.1.3

Choose a tag to compare

@ASaltedFishBoy ASaltedFishBoy released this 23 Oct 13:02
· 14 commits to main since this release

asf_dyn v0.1.3

This release introduces the initial public version of asf_dyn, a C++26 reflection-based trait system with Rust-like dyn semantics, trait dispatch, and upcasting support.

Overview

asf_dyn provides a header-only C++ library for trait-like polymorphism using GCC reflection. The design centers around:

  • Trait definitions via Trait<void> / Trait<T>
  • Static handles through iface
  • Erased dynamic handles through dyn
  • Optional mirror-based field reflection
  • Trait upcasting and dispatch through generated vtable metadata

This project is intended for advanced C++ users and library authors exploring reflection-driven polymorphism and low-level dispatch design.

Requirements

  • GCC 16 or newer
  • C++26 with reflection enabled
  • CMake 3.28+
  • Link against stdc++exp when using GCC reflection mode

Installation

The library is header-only; include the project's include/ directory in your build and compile with the required reflection flags.

Highlights

  • Full Rust-like conceptual mapping for trait/interface/dyn behavior
  • Supports dyn upcasting and trait casts across inheritance paths
  • Multiple feature configuration modes
    • RTTI support
    • intermediate bind support
    • multi-vtable mode
    • single-inheritance configuration
  • Extensive test suite and compile-fail coverage
  • Benchmark support against Microsoft proxy
  • Bilingual documentation in English and Chinese

Known limitations

  • Requires GCC 16 reflection support; broader compiler support is not yet the primary target
  • API and behavior may change as the reflection-based model matures
  • Certain trait or inheritance patterns are intentionally restricted or require feature-specific configuration
  • This is a source-based header library rather than a binary-distributed package

Compatibility

  • Primary supported environment: Linux + GCC 16 / Win + MinGW 16
  • This release is the initial release and the engineering maturity needs to be verified.

License

Boost Software License 1.0

Notes

This is an early-stage release, it is suitable for library authors and advanced users exploring new trait object models, but users should expect continued change as the design matures.