Macro Subspace :: sus_dyn_concept

#define sus_dyn_concept(Concept, DynConcept, DynConceptTyped)

Macro to help implement DynC for a concept C. The macro is placed in the body of the DynC class.

Here DynC is used as a placeholder name to refer to the virtual class that type-erases for the concept C. The type erasure class is typically named to match the concept, with a "Dyn" prefix. The type-aware subclass of the type erasure class is typically named to match the concept with a "Dyn" prefix and a "Typed" suffix.

The Concept parameter is the concept C for which types are being type-erased.

The DynConcept parameter is the name of the type-erasure class DynC which the macro is written within, and which has a pure virtual interface matching the concept's requirements.

The DynConceptTyped parameter is the type-aware subclass of DynC which contains the sus_dyn_concept_typed macro in its body, and the implementation of the virtual interface that forwards calls through to the concrete type.

See DynConcept for more on type erasure of concept-satisfying types, and DynConcept examples for examples of using the macro.