tanuki

tanuki#

tanukis are a kind of supernatural beings found in the classics and in the folklore and legends of various places in Japan. They are reputed to be mischievous and jolly, masters of disguise and shapeshifting but somewhat gullible and absent-minded.

tanuki is a small, single-header and self-contained C++20 toolkit for type-erasure. Main features include:

  • high configurability,

  • support for both value and reference semantics,

  • small object optimisation to avoid dynamic memory allocation,

  • the ability to type-erase references,

  • support for composite interfaces,

  • optional support for Boost.serialization.

Interfaces are defined and implemented blending the familiar language of traditional object-oriented programming (i.e., abstract base clasess, default implementations, single/multiple inheritance, etc.) with C++20 concepts.